<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Debug School: Steed47</title>
    <description>The latest articles on Debug School by Steed47 (@steed47).</description>
    <link>https://www.debug.school/steed47</link>
    <image>
      <url>https://www.debug.school/images/MliqC1c7leMj0uYXwndtkTPhbUyp7VBgOEqWNP3hBs4/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvdXNl/ci9wcm9maWxlX2lt/YWdlLzY5MC85ZjZi/MjY2NS0wMjExLTQx/MmQtOGJjZC03OTgz/NTFmOGIyZTMucG5n</url>
      <title>Debug School: Steed47</title>
      <link>https://www.debug.school/steed47</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/steed47"/>
    <language>en</language>
    <item>
      <title>Terraform-Day2-2</title>
      <dc:creator>Steed47</dc:creator>
      <pubDate>Tue, 19 Sep 2023 08:55:50 +0000</pubDate>
      <link>https://www.debug.school/steed47/terraform-day2-2-485p</link>
      <guid>https://www.debug.school/steed47/terraform-day2-2-485p</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Write a terraform code would create following resources


#Resource to create a SSH private key
resource "tls_private_key" "kahwo_key" {
  algorithm = "RSA"
  rsa_bits  = 4096
}

resource "aws_key_pair" "kahwo_key_pair" {
  key_name   = "kahwo-keypair"
  public_key = tls_private_key.kahwo_key.public_key_openssh
}



# - Display a pvt on Console

output "private_key" {
  value = tls_private_key.kahwo_key.private_key_pem
  sensitive = true
}

# - Create a Security group must open 80 Port

resource "aws_security_group" "NSG-kahwo" {
  name        = "kahwo-security-group"
  description = "Open Port 80"

  # Ingress rule for HTTP (port 80)
  ingress {
    from_port   = 80
    to_port     = 80
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"] 
  }

  # Ingress rule for SSH (port 22)
  ingress {
    from_port   = 22
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"] 
  }
  egress {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }



}


# - Create a Ec2 instance Ubuntu using the same Key &amp;amp; SG which you created above.
resource "aws_instance" "create_ec2" {
  ami           = "ami-053b0d53c279acc90"
  instance_type = "t2.micro"
  key_name      = aws_key_pair.kahwo_key_pair.key_name
  vpc_security_group_ids = [aws_security_group.NSG-kahwo.id]
  tags = {
    Name = "kahwo"
  }

  connection {
      type     = "ssh"
      user     = "ubuntu"
      private_key = tls_private_key.kahwo_key.private_key_pem
      #host = aws_instance.web.public_ip
      host = self.public_ip
  }

  provisioner "remote-exec" {
    inline = [
      "sudo apt-get update",
      "sudo apt-get install apache2 -y",
      "sudo systemctl start apache2"
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Terrafom 19/9/2023</title>
      <dc:creator>Steed47</dc:creator>
      <pubDate>Tue, 19 Sep 2023 01:32:25 +0000</pubDate>
      <link>https://www.debug.school/steed47/terrafom-1992023-1oee</link>
      <guid>https://www.debug.school/steed47/terrafom-1992023-1oee</guid>
      <description>&lt;p&gt;Why do we need terraform?&lt;br&gt;
Terraform is needed for infrastructure as code (IaC), to automate tedious manual tasks, so can save manhours. Automation through terraform also able minimize human errors, and operate 24/7.&lt;/p&gt;

&lt;p&gt;What is Providers?&lt;br&gt;
Plugins that allow us to interact with and manage infrastructure and service platforms, example : AWS, Azure, Google Cloud.&lt;/p&gt;

&lt;p&gt;What is Resources?&lt;br&gt;
Infrastructure that we define and manage. These resources represent various components of infrastructure, such as virtual machines, networks, and more&lt;/p&gt;

&lt;p&gt;List out Top 8 Commands which we have learnt so far?&lt;br&gt;
Terraform init, terraform plan, terraform apply, terraform destroy, terraform output, terraform validate&lt;/p&gt;

&lt;p&gt;What are the block we have used in .tf file?&lt;br&gt;
To define various configuration elements for infrastructure resources&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
