DevOps Classroom notes 23/Aug/2026

terraform refresh

  • reconciles Terraform statefile with real infrastructure – out what changes compare with statefile and aws resources

  • terraform refresh

task – create ec2 instance with terraform after creation do manual changes in ec2 like tag or instance type …etc and check plan after changes then terraform refresh show the differances.

Terraform graph

  • Outpts as a dependency graph in (DOT format) showing in order terraform will create/modifed/destory/replace resources.
  • Install dotnet choco install dotnet-sdk -y
  • reboot system
  • terraform init && terraform graph -type=plan | dot -Tpng >graph.png
  • Refer Terraform graph

Type of conversion:

Refer types of conversions

  1. converts values to string
    • tostring(X) ==> tostring(5) ==> "5"
  2. converts value to number tonumber("X") ==> tonumber("7") ==> 7
  3. converts value to an ordered list tolist(x) ==> tolist(toset(["b", "a"])) ==> ["b", "a"]
  4. converts value to a map tomap({"a=1","b=2"}) ==> { a=1 , b=2}
  5. return true/false can(x) ==> can (cidrhost(var.cidr, 0)) ==> false

Task:

  • create ec2 instance using module and install apache2 and use above conversions

  • Next topics

  • terraform azure

    • azure cli & terrafom cli install vm
    • terraform backend setup
    • how to auth azure in vm
    • create resources and make it variables
    • using copilate / ai tools will generate code.

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 Responsive Web Designing 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