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,260 points
674 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,460 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 4, 2019 in Others by sindhu
699 views
0 votes
0 answers

How to create a Wordlist generator in Golang?

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

Jul 14, 2019 in Others by Raj
• 180 points
881 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,460 points
745 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,460 points
663 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,020 points
2,715 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 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,460 points
888 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,460 points
749 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP