DevOps Classroom notes 11/Aug/2026

Terraform Backend:

  • store statefile in remote location.
  • terraform.tfstate

types:

  • local: its store file in local
  • remote : its store file in remote

AWS Backend Flow

flowchart TD
    A[terraform init] --> B[Read backend config: S3 bucket + DynamoDB table]
    B --> C{State file exists in S3?}
    C -->|Yes| D[Download state from S3]
    C -->|No| E[Initialize empty state]
    D --> F[terraform plan / apply]
    E --> F
    F --> G[Acquire lock: write LockID item to DynamoDB]
    G --> H{Lock acquired?}
    H -->|No| I[Error: state locked by another user/process]
    H -->|Yes| J[Execute plan/apply against AWS resources]
    J --> K[Write updated state back to S3 bucket]
    K --> L[Release lock: delete LockID item from DynamoDB]

Task:

  1. create github workflow for terraform and configure cridentals in secrets
  2. steps:
    1. checkout
    2. install/setup terraform
    3. aws cridentals configure
    4. terrform init
    5. terraform fmt
    6. terraform validate
    7. if condition terraform action – plan , apply, none
      1. paln
      2. plan and apply -auto-approve

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%%