How to create subnet inside a VPC in AWS using Terraform

0 votes

Hi Guys,

I have created one VPC in AWS. Now I want to create one subnet inside this VPC using my Terraform code. How can I do this?

Jul 21, 2020 in Others by akhtar
• 38,180 points
75 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to use aws_subnet resource inside your VPC. This will allow you to create a subnet inside your VPC. I have attached one example below for your reference.

resource "aws_subnet" "main" {
  vpc_id     = "${aws_vpc.main.id}"
  cidr_block = "10.0.1.0/24"
  tags = {
    Name = "Main"
  }
}
answered Jul 21, 2020 by MD
• 95,140 points

Related Questions In Others

0 votes
0 answers

How to create a batch file in windows?

What is a batch file and How ...READ MORE

Jul 3, 2019 in Others by sindhu
136 views
0 votes
0 answers

How to create a Wordlist generator in Golang?

I want to create a Wordlist Generator ...READ MORE

Jul 13, 2019 in Others by Raj
• 180 points
197 views
0 votes
1 answer

How to create a Map in Dart Language?

Hi@akhtar, You need to create one variable and ...READ MORE

answered Jul 23, 2020 in Others by MD
• 95,140 points
92 views
0 votes
1 answer

How to create a App using Material Design?

Hi@akhtar, You need to use the MaterialApp method ...READ MORE

answered Jul 23, 2020 in Others by MD
• 95,140 points
74 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
1,112 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,037 views
0 votes
1 answer

How to create a Project in Flutter?

Hi@akhtar, Flutter has an inbuilt command to create ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,140 points
134 views
0 votes
1 answer

How to create a function in Dart language?

Hi@akhtar, There are many function types available in ...READ MORE

answered Jul 22, 2020 in Others by MD
• 95,140 points
99 views