How to add a route for IGW in AWS using Terraform code

0 votes

Hi Guys,

I have one routing table in my VPC. I want to add one route in this routing table for Internet Gateway using Terraform code. How can I do that?

Jul 22, 2020 in Terraform by akhtar
• 38,230 points
3,796 views

1 answer to this question.

0 votes

Hi@akhtar,

Terraform has one keyword named route. It allows us to create a route in our routing table. You can see the below-given example.

resource "aws_route_table" "table" {
  vpc_id = "${aws_vpc.main.id}"
route {
    cidr_block = "0.0.0.0/0"
    gateway_id = "${aws_internet_gateway.gw.id}"
  }
}
answered Jul 22, 2020 by MD
• 95,440 points

Related Questions In Terraform

0 votes
1 answer

How to create a VPC in AWS using Terraform?

Hi@akhtar, You can find the script in the ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,440 points
1,102 views
0 votes
1 answer

How to create a policy for AWS EFS file system using Terraform?

Hi@akhtar, You can find one resource in Terraform ...READ MORE

answered Sep 9, 2020 in Terraform by MD
• 95,440 points
1,833 views
0 votes
1 answer

How to create a VPC in GCP Cloud using Terraform code?

Hi@akhtar, You can create your own VPC in ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,440 points
1,398 views
0 votes
1 answer

How to set an IAM policy for a project in GCP using Terraform?

Hi@akhtar, You can create a policy and give ...READ MORE

answered Sep 13, 2020 in Terraform by akhtar
• 38,230 points
1,301 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,090 points
2,435 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
3,460 views
0 votes
1 answer

How to create a route table in AWS using Terraform code?

Hi@akhtar, You can use aws_route_table resources in your ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,440 points
5,274 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,440 points
2,433 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