TA-002-P · Question #354
You want to share Terraform state with your team, store it securely and provide state locking. How would you do this? Choose three correct answers.
The correct answer is A. Using the consul Terraform backend. B. Using the remote Terraform backend with Terraform Cloud / Terraform Enterprise. E. Using an s3 terraform backend with an appropriate IAM policy and dynamodb_field option. To securely share Terraform state with a team and enable state locking, you would typically use a remote backend like Consul, Terraform Cloud/Enterprise, or an S3 backend with DynamoDB for locking.
Question
You want to share Terraform state with your team, store it securely and provide state locking. How would you do this? Choose three correct answers.
Options
- AUsing the consul Terraform backend.
- BUsing the remote Terraform backend with Terraform Cloud / Terraform Enterprise.
- CUsing the local backend.
- DUsing the s3 terraform backend. The dynamodb_field option e not needed.
- EUsing an s3 terraform backend with an appropriate IAM policy and dynamodb_field option
How the community answered
(66 responses)- A74% (49)
- C9% (6)
- D17% (11)
Why each option
To securely share Terraform state with a team and enable state locking, you would typically use a remote backend like Consul, Terraform Cloud/Enterprise, or an S3 backend with DynamoDB for locking.
The Consul backend provides a robust solution for shared state storage and includes built-in state locking capabilities, making it suitable for team environments.
Terraform Cloud and Terraform Enterprise offer managed remote backends that inherently provide secure, shared state, versioning, and state locking features, ideal for collaborative team workflows.
The local backend stores the state file on the local filesystem, which is unsuitable for team collaboration, secure sharing, or state locking.
An S3 backend alone only provides storage; without a separate locking mechanism like DynamoDB, it does not prevent concurrent state modifications, which is crucial for team environments.
An S3 backend stores the state file in a highly available and durable object storage, and integrating it with DynamoDB (via `dynamodb_table` option, not `dynamodb_field`) provides the necessary state locking mechanism to prevent concurrent state modifications.
Concept tested: Terraform remote backends for shared state and locking
Source: https://developer.hashicorp.com/terraform/language/settings/backends/s3
Topics
Community Discussion
No community discussion yet for this question.