0
0
Terraformcloud~5 mins

Terraform in GitHub Actions - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of using Terraform in GitHub Actions?
To automate infrastructure deployment and management directly from GitHub workflows, enabling continuous infrastructure as code.
Click to reveal answer
beginner
Which GitHub Actions step is used to initialize Terraform before applying changes?
The terraform init command initializes the working directory containing Terraform configuration files.
Click to reveal answer
intermediate
Why should Terraform state files be stored remotely when using GitHub Actions?
To allow multiple runs and team members to share the same state safely, preventing conflicts and ensuring consistent infrastructure state.
Click to reveal answer
beginner
What is the role of secrets in GitHub Actions when running Terraform workflows?
Secrets securely store sensitive data like cloud provider credentials, which are injected into workflows without exposing them in logs or code.
Click to reveal answer
beginner
How does the terraform plan step help in GitHub Actions workflows?
It previews the changes Terraform will make to the infrastructure, allowing review before applying to avoid unintended modifications.
Click to reveal answer
What command should run first in a Terraform GitHub Actions workflow?
Aterraform destroy
Bterraform apply
Cterraform plan
Dterraform init
Where should Terraform state files be stored for safe collaboration in GitHub Actions?
ALocally on the runner
BIn the GitHub repository
CIn a remote backend like AWS S3 or Terraform Cloud
DIn environment variables
How do you securely provide cloud credentials to Terraform in GitHub Actions?
AHardcode them in the workflow file
BUse GitHub Secrets and inject them as environment variables
CStore them in the Terraform configuration files
DSend them via email
What does the terraform apply command do in a GitHub Actions workflow?
AApplies the planned infrastructure changes
BInitializes Terraform providers
CShows planned changes without applying
DDeletes all infrastructure
Why include a terraform plan step before terraform apply?
ATo preview changes and catch errors early
BTo speed up deployment
CTo delete old resources
DTo initialize Terraform
Explain the typical steps in a GitHub Actions workflow that uses Terraform to deploy infrastructure.
Think about setup, review, and deployment phases.
You got /5 concepts.
    Describe why storing Terraform state remotely is important when using GitHub Actions.
    Consider collaboration and safety.
    You got /4 concepts.