Challenge - 5 Problems
Terraform GitLab CI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Configuration
intermediate2:00remaining
Terraform GitLab CI Pipeline Stage Order
Given the following GitLab CI stages for Terraform, what is the correct order to ensure safe infrastructure deployment?
Attempts:
2 left
💡 Hint
Initialization must happen before validation and planning.
✗ Incorrect
Terraform requires initialization first to set up backend and providers, then validation to check syntax, planning to preview changes, and finally apply to execute changes.
❓ security
intermediate2:00remaining
Protecting Terraform State in GitLab CI
Which option best secures Terraform state files when running Terraform in GitLab CI pipelines?
Attempts:
2 left
💡 Hint
State files contain sensitive info and must be protected and shared safely.
✗ Incorrect
Using a remote backend with encryption and access control ensures state files are secure and consistent across pipeline runs.
❓ service_behavior
advanced2:00remaining
Terraform Apply Behavior in GitLab CI with Auto-Approve
What is the effect of adding the '-auto-approve' flag to 'terraform apply' in a GitLab CI pipeline?
Attempts:
2 left
💡 Hint
Think about automation and manual steps in CI pipelines.
✗ Incorrect
The '-auto-approve' flag skips the interactive approval prompt, allowing automated pipelines to apply changes without manual intervention.
❓ Architecture
advanced2:00remaining
Managing Multiple Environments with Terraform in GitLab CI
Which approach best isolates Terraform state and variables for multiple environments (e.g., dev, staging, prod) in GitLab CI?
Attempts:
2 left
💡 Hint
Isolation prevents accidental cross-environment changes.
✗ Incorrect
Separate workspaces or backend state files per environment keep state isolated and reduce risk of conflicts or accidental changes.
✅ Best Practice
expert2:00remaining
Handling Sensitive Variables in GitLab CI for Terraform
What is the best practice to securely provide sensitive variables (like AWS credentials) to Terraform in GitLab CI pipelines?
Attempts:
2 left
💡 Hint
Think about GitLab features designed for secrets management.
✗ Incorrect
GitLab CI protected variables securely store secrets and inject them into pipelines without exposing them in code or logs.