> For the complete documentation index, see [llms.txt](https://rajan-silwal-1.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rajan-silwal-1.gitbook.io/product-docs/automation-tools/terraform/create-vpc-using-.tf.md).

# Create VPC using .tf

Here we will create a VPC using terraform. We will add following line of code in **main.tf** file

```
resource "aws_vpc" "usa_vpc"{
    cidr_block = "10.0.0.0/16"
    enable_dns_hostnames = true

    tags = {
        Name = "usa"
    }
}
```

**Run** <br>

```
terraform init
terraform plan # plan show overview of what will this code do
terraform apply 
```

Now we will see the following ouput after we **terraform apply**<br>

<figure><img src="https://1186894440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wnMXVEmEJ7k6VEhLJYN%2Fuploads%2FDHakdbUMt8sqIwGnVQ1H%2FScreen%20Shot%202022-11-06%20at%204.15.12%20PM.png?alt=media&amp;token=73b99506-16d3-442f-840a-e7c32defcd44" alt=""><figcaption></figcaption></figure>

Final step is to check in our AWS console page: Go to aws.console.amazon and go to VPC you will see the new VPC that we create from **terraform apply**<br>

<figure><img src="https://1186894440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wnMXVEmEJ7k6VEhLJYN%2Fuploads%2F1kw2P9kuUxegSjN0UJnn%2FScreen%20Shot%202022-11-06%20at%204.16.21%20PM.png?alt=media&amp;token=0b00be5c-b52e-4fd7-9158-ce9d1dfe998b" alt=""><figcaption></figcaption></figure>
