GCP Classroom notes 25/Oct/2024

Terraform

Activity 1:

  • Lets realize the following architecture
    Preview
  • Refer Here for the changes
  • Generally resources have dependencies which in turn determine the order of creation
  • Dependencies are of two types
    • explicit: This is created with the help of depends_on meta argument Refer Here
    • implicit: This is created while using attributes of other resources
  • Refer Here for changes to make dependencies explicit
  • Now lets use variables to accept the project id as input Refer Here
  • Refer Here for the changes done
    Preview
  • Lets also add variables for subnets Refer Here for the changes done to add subnet variables
  • when we have many variables passing them by adding multiple -var during terraform apply becomes difficult to manage we can use tfvars file Refer Here
  • Refer Here for the changes.
    Preview
  • Terraform count to create multiple resources Refer Here
  • Refer Here for the usage of count for subnets
  • We can acheive the same results or similar results with for_each as well Refer Here
  • Refer Here for the changes done

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube