DevOps Classroomnotes 29/Jul/2023

Terraform contd

  • Order of Creation: Order of creation can be acheived in two ways
    • explicit dependency using depends_on Refer Here
    • implicit dependency: Terraform figures out by looking at your configuration/template
      • When the output (attribute) of one resource is used as input (argument) to other
      • Refer Here for the changes
  • To use one resource in other resource argument <resource_type>.<name>
depends_on = [ azurerm_resource_group.myresg ]

Best Practice to write terraform template (Based on what we have covered so far)

  • Terraform reads all the .tf files in the folder and then combines as one file and executes the terraform => While writing terraform templates there is no need write everything in one file
    • From now one lets have one tf for provdier and then one tf file for logical group of resources.
    • All the variables will be in one file inputs.tf and all the outputs will be in the file outputs.tf
      Preview
  • Use terraform fmt to align the terraform template into common canonical format Refer Here for the changes done

Manual Steps for next activity

  • Azure
    Preview
  • AWS
    Preview

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
Animated Social Media Icons by Acurax Wordpress Development 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