<?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>DEV Community: AZEEZ KAMALDEEN</title>
    <description>The latest articles on DEV Community by AZEEZ KAMALDEEN (@member_d90db6e6).</description>
    <link>https://dev.to/member_d90db6e6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4009635%2F19332dae-e08a-4e01-9601-fc2068582049.png</url>
      <title>DEV Community: AZEEZ KAMALDEEN</title>
      <link>https://dev.to/member_d90db6e6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/member_d90db6e6"/>
    <language>en</language>
    <item>
      <title>I Created My First AWS EC2 Instance with Terraform</title>
      <dc:creator>AZEEZ KAMALDEEN</dc:creator>
      <pubDate>Tue, 30 Jun 2026 13:00:20 +0000</pubDate>
      <link>https://dev.to/member_d90db6e6/i-created-my-first-aws-ec2-instance-with-terraform-13np</link>
      <guid>https://dev.to/member_d90db6e6/i-created-my-first-aws-ec2-instance-with-terraform-13np</guid>
      <description>&lt;p&gt;I recently started working with the AWS console and Elastic Cloud Computing(Ec2), and let me tell you, it has been so much fun&lt;/p&gt;

&lt;p&gt;But there’s something even better.&lt;/p&gt;

&lt;p&gt;I deployed the exact same server with a very few lines of code.&lt;/p&gt;

&lt;p&gt;It wasn’t perfect, there were errors and confusions, and I visited Stack Overflow more than I ever have. But when Terraform apply finally completed with no errors, and I refreshed the AWS console to see my instance running, I realized I had just crossed a huge milestone in my cloud journey.&lt;/p&gt;

&lt;p&gt;Why I Decided to Learn Terraform&lt;/p&gt;

&lt;p&gt;I’ve been learning AWS for a while now, and I noticed a few problems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I was clicking everything manually,&lt;br&gt;
Launch Instance&lt;br&gt;
Choose AMI&lt;br&gt;
Choose Instance Type&lt;br&gt;
Configure Storage&lt;br&gt;
Security Groups&lt;br&gt;
Key Pair&lt;br&gt;
Networking&lt;br&gt;
I know this doesn’t seem like much, but when you start working with large servers and identical servers, it starts to get tedious.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I forget what I configured sometimes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I know this sounds like a skill issue, but sometimes I forget what I configured. I mean, we have the security groups, inbound rule, outbound rule, subnets, route tables, internet gateway, VPC, and believe me, I’m not remembering all of that ten minutes later.&lt;/p&gt;

&lt;p&gt;But that’s where Terraform comes in.&lt;/p&gt;

&lt;p&gt;Everything is written in code.&lt;/p&gt;

&lt;p&gt;resource “aws_security_group” “web” {&lt;/p&gt;

&lt;p&gt;No guessing&lt;/p&gt;

&lt;p&gt;3.I’m very clumsy, and sometimes I accidentally click the wrong things&lt;/p&gt;

&lt;p&gt;I think everyone eventually does this sometimes&lt;/p&gt;

&lt;p&gt;Delete a security group.&lt;/p&gt;

&lt;p&gt;Delete a subnet.&lt;/p&gt;

&lt;p&gt;Terminate an EC2.&lt;/p&gt;

&lt;p&gt;Terraform fixes this&lt;/p&gt;

&lt;p&gt;You review&lt;/p&gt;

&lt;p&gt;terraform plan&lt;br&gt;
before&lt;/p&gt;

&lt;p&gt;terraform apply&lt;br&gt;
Nothing changes accidentally.&lt;/p&gt;

&lt;p&gt;Become a Medium member&lt;br&gt;
4.Hidden costs.&lt;/p&gt;

&lt;p&gt;Back to my issue of forgetfulness, there are times when I forget I created Elastic IPs or EBS gateways, and then I just wake up to a bill&lt;/p&gt;

&lt;p&gt;But Terraform fixes this&lt;/p&gt;

&lt;p&gt;Everything Terraform creates can be destroyed in one command:&lt;/p&gt;

&lt;p&gt;terraform destroy&lt;br&gt;
Reducing the chance of forgotten resources continuing to incur charges.&lt;/p&gt;

&lt;p&gt;My First Terraform Configuration&lt;/p&gt;

&lt;p&gt;Well, it didn’t really go well the first time&lt;/p&gt;

&lt;p&gt;The reality wasn’t as smooth as tutorials&lt;/p&gt;

&lt;p&gt;I got errors.&lt;/p&gt;

&lt;p&gt;The AMI I wanted didn’t exist in my region.&lt;/p&gt;

&lt;p&gt;My key pair wasn’t found.&lt;/p&gt;

&lt;p&gt;SSH refused to let me into my instance.&lt;/p&gt;

&lt;p&gt;Sometimes Terraform said everything was fine, but AWS showed something completely different.&lt;/p&gt;

&lt;p&gt;Each error forced me to slow down and actually understand what Terraform was trying to do instead of blindly following a tutorial.&lt;/p&gt;

&lt;p&gt;At its core, my configuration was very basic&lt;/p&gt;

&lt;p&gt;I defined:&lt;/p&gt;

&lt;p&gt;An AWS provider&lt;br&gt;
An EC2 instance resource&lt;br&gt;
The instance type&lt;br&gt;
The AMI&lt;br&gt;
My key pair&lt;br&gt;
Basic networking settings&lt;br&gt;
Then came the commands that every article and tutorial I watched were spamming :&lt;/p&gt;

&lt;p&gt;terraform init&lt;br&gt;
terraform plan&lt;br&gt;
terraform apply&lt;br&gt;
The first initializes the project.&lt;/p&gt;

&lt;p&gt;The second shows exactly what Terraform intends to create.&lt;/p&gt;

&lt;p&gt;The third makes it happen.&lt;/p&gt;

&lt;p&gt;The moment Terraform finished, I refreshed the AWS Console.&lt;/p&gt;

&lt;p&gt;There it was.&lt;/p&gt;

&lt;p&gt;A brand-new EC2 instance.&lt;/p&gt;

&lt;p&gt;Created entirely from code.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>terraform</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
