DevOps Classroom notes 12/Nov/2025

Child resources as blocks and as different resources

  • Added child resources as block and as different resources. Refer Here for the changeset which contains the above example

Files/Folders created during terraform apply or init

  • image
  • .terraform folder consists of provider that got downloaded and going down the line modules will be downloaded here
  • .terraform.lock.hcl: This contains the info about provider downloaded with hashes of it
  • terraform.tfstate: This is state file which contains info about state (what was created)
  • terraform.tfstate.backup: This is state files backup which contains info about state (what was created) of last successful creation (n-1)

Terraform state

  • Terraform state is like a record of what was created by terraform.
  • This file by default will be created in the same folder where we execute terraform.
  • This file should never be edited.
  • Terraform looks into state for what was created
  • Terraform applies the refresh operation to get the current state from the provider
  • Then terraform finds the difference between desired state vs actual state. Difference will become plan

Case 1: Reapplying the terraform

  • Refresh is applied and then terraform finds the desired state is already available and does nothing

Case 2: Resource is changed manually after creation by terraform

  • Refresh is applied, changes will be found
  • Plan will be created According to the provider, this might be update in place or replacement

Case 3: Resource is deleted manually after creation by terraform

  • Refresh is applied, changes will be found
  • Plan will be created to recreate

Case 4: state is deleted

  • Terraform forgets about what it has done in the past and treats it as new resource creation.

Terraform state operations

  • Showing state
  • list state
  • Refer Here for sample used in class.

Optional type attributes

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
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%