0
0
Terraformcloud~10 mins

Terraform Cloud/Enterprise features - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Terraform Cloud/Enterprise features
Start Terraform Cloud/Enterprise
User Pushes Code to VCS
Terraform Cloud Detects Change
Run Plan Automatically
User Reviews Plan
Apply Approved Plan
State Stored Securely
Collaboration & Policy Checks
End
This flow shows how Terraform Cloud/Enterprise automates infrastructure changes from code push to secure state storage with collaboration and policy enforcement.
Execution Sample
Terraform
terraform {
  cloud {
    organization = "my-org"
    workspaces {
      name = "my-workspace"
    }
  }
}
This code configures Terraform to use Terraform Cloud with a specific organization and workspace.
Process Table
StepActionResultNotes
1User pushes Terraform code to version controlTerraform Cloud detects new codeTriggers run automatically
2Terraform Cloud starts plan phasePlan created showing proposed changesUser can review plan
3User approves planTerraform Cloud applies changesInfrastructure updated
4Terraform Cloud stores state securelyState file saved in cloud backendEnables collaboration
5Policy checks run during plan/applyRuns Sentinel policiesBlocks changes if policy fails
6Team members collaborateShared workspace and notificationsImproves teamwork
7Run completesOutputs availableInfrastructure ready
8No new code changesNo new runs triggeredIdle state
💡 No new code changes detected, so no further runs triggered.
Status Tracker
VariableStartAfter Step 1After Step 3Final
Terraform CodeNot presentPushed to VCSUsed for applyStored in VCS
Run StatusIdlePlanningAppliedIdle
State FileLocal or noneNot updatedUpdated in cloudStored securely
Policy StatusNot checkedChecked during planChecked during applyPassed or blocked
Key Moments - 3 Insights
Why does Terraform Cloud run a plan automatically after code is pushed?
Terraform Cloud detects the code change (see execution_table step 1) and runs a plan to show proposed changes before applying, ensuring safety.
How does Terraform Cloud ensure team collaboration?
By storing state securely in the cloud backend and sharing workspace runs and notifications (execution_table steps 4 and 6), team members can work together safely.
What happens if a policy check fails during apply?
The apply is blocked by Terraform Cloud's Sentinel policy enforcement (execution_table step 5), preventing unsafe changes.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the run status after step 3?
AIdle
BPlanning
CApplied
DFailed
💡 Hint
Check the 'Run Status' variable in variable_tracker after Step 3.
At which step does Terraform Cloud store the state file securely?
AStep 2
BStep 4
CStep 6
DStep 8
💡 Hint
Look at the 'State File' variable changes and execution_table step descriptions.
If no new code is pushed, what happens according to the execution_table?
ANo new runs are triggered
BTerraform Cloud runs a plan anyway
CTerraform Cloud applies previous plan
DPolicy checks run repeatedly
💡 Hint
See the exit_note and step 8 in execution_table.
Concept Snapshot
Terraform Cloud/Enterprise automates infrastructure changes by detecting code pushes,
running plans for review, applying approved changes, and storing state securely.
It supports team collaboration and enforces policies to keep infrastructure safe.
Use cloud backend configuration to connect Terraform to Terraform Cloud.
Policy checks run automatically during plan and apply phases.
No runs happen without new code changes.
Full Transcript
Terraform Cloud and Enterprise provide a way to automate and manage infrastructure changes safely. When a user pushes Terraform code to version control, Terraform Cloud detects the change and automatically runs a plan. This plan shows what changes will happen, allowing the user to review before applying. Once approved, Terraform Cloud applies the changes and securely stores the state file in the cloud backend. This setup enables team collaboration by sharing state and run information. Additionally, policy checks run during plan and apply phases to enforce rules and prevent unsafe changes. If no new code is pushed, Terraform Cloud does not trigger new runs, keeping the system idle until changes occur.