GCP Classroom notes 25/Oct/2024

Terraform

Activity 1:

  • Lets realize the following architecture
  • 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
  • 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.
  • 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 comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers
Exit mobile version
%%footer%%