Level1 - Terraform - Task 3

Creation of VPC using Terraform marked incorrectly. Please find screen shot of the existence of the required VPC.

Hi @vr2025

Can you please share the Terraform code you used to create the VPC?

Hi Santosh,

I used the existing provider file and used the below on the main.tf:
resource “aws_vpc” “devops-vpc” {
cidr_block = “10.0.0.0/16”
}

Try adding a tag:

resource "aws_vpc" "devops-vpc" {
  cidr_block       = "10.0.0.0/16"

  tags = {
    Name = "devops-vpc"
  }
}

Thanks Santosh, I tried with the tags and it worked.
Interesting, the task didn’t contain creation of tags.

It’s something to know about AWS: if the console doesn’t give you an option to name a resource, but allows you to create a tag, then use the “Name” tag to give the resource a name.