DevOps Classroom Series – 03/Mar/2021

Terraform with AWS Contd..

  • We have created the vpc with six subnets

  • We need to add internet gateway to the aws and attach internet gateway to vpc

  • Lets look at manual steps Preview Preview Preview Preview

  • Now navigate to terraform aws provider documentation Refer Here and search for internet gateway Preview

  • For the documentation of internet gateway Refer Here

  • Make changes in the template to accomodate creation of internet gateway Refer Here for the changes Preview Preview

  • The current architecture looks as shown below Preview

  • Now we need to create route table called as public route table and connect it to web1 and web2 subnet

  • Manual steps Preview Preview Preview Preview Preview Preview

  • Now search for route table resource. Refer Here for the documentation Preview

  • To associate route table with subnets Refer Here

  • Lets make changes Refer Here for the changes Preview Preview

  • Now lets create a private subnet and associate app1, app2, db1 and db2 subnets Refer Here for the changeset Preview

  • In our template we have written the following to create private route table associations, which sounds like a hack Preview

  • It would be better if we use each kind of syntax

colors = ['red', 'green', 'blue']

for color in colors:
    print color
  • So to refactor our template to look something like above, we need to have an option to query the aws to retrieve subnet ids and then use for each

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin