Challenge - 5 Problems
DynamoDB State Locking Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Configuration
intermediate2:00remaining
Terraform backend configuration for DynamoDB state locking
Which Terraform backend configuration snippet correctly enables state locking using a DynamoDB table named
tf-lock-table in the us-west-2 region?Attempts:
2 left
💡 Hint
Look for the correct attribute name to enable DynamoDB state locking and ensure encryption is enabled.
✗ Incorrect
The correct attribute to enable state locking with DynamoDB in Terraform's S3 backend is
dynamodb_table. Encryption should be enabled for security best practices.❓ Architecture
intermediate2:00remaining
DynamoDB table design for Terraform state locking
Which DynamoDB table design is required to support Terraform state locking correctly?
Attempts:
2 left
💡 Hint
Terraform expects a simple primary key named
LockID for locking.✗ Incorrect
Terraform requires a DynamoDB table with a simple primary key named
LockID of type string to manage locks properly.❓ service_behavior
advanced2:00remaining
Effect of missing DynamoDB table on Terraform state locking
What happens when Terraform tries to acquire a lock using a DynamoDB table that does not exist?
Attempts:
2 left
💡 Hint
Terraform requires the DynamoDB table to exist before locking.
✗ Incorrect
Terraform does not create the DynamoDB table automatically. If the table is missing, it fails with an error and stops to prevent unsafe state changes.
❓ security
advanced2:00remaining
IAM policy for Terraform to use DynamoDB state locking
Which IAM policy snippet grants the minimum required permissions for Terraform to use DynamoDB state locking on a table named
tf-lock-table?Attempts:
2 left
💡 Hint
Terraform needs to create, read, and delete lock items.
✗ Incorrect
Terraform requires permissions to put, get, and delete items in the DynamoDB table to manage locks properly.
✅ Best Practice
expert3:00remaining
Ensuring high availability for Terraform state locking with DynamoDB
Which approach best ensures high availability and durability for Terraform state locking using DynamoDB in a multi-region AWS setup?
Attempts:
2 left
💡 Hint
Think about automatic replication and consistency across regions.
✗ Incorrect
DynamoDB global tables replicate data across regions automatically, providing high availability and durability for state locking in multi-region setups.