Skip to content

Conversation

@sean-navapbc
Copy link
Collaborator

Summary

Changes

  1. Backend configuration files: Replaced dynamodb_table = "..." with use_lockfile = true in all .tfbackend files
  2. terraform-backend-s3 module:
    • Added enable_dynamodb_lock_table variable (default: false)
    • Made DynamoDB table and KMS key creation conditional
    • Updated README with S3 native locking documentation
  3. accounts/main.tf: Set enable_dynamodb_lock_table = true to continue managing the existing DynamoDB table

Migration Notes

  • The existing DynamoDB table is preserved but no longer used for locking
  • S3 native locking uses conditional writes to the state file instead of DynamoDB
  • The DynamoDB table can be manually deleted in a future cleanup PR once this migration is verified

Test plan

  • Verify terraform init works with new backend configuration
  • Verify terraform plan/apply works with S3 native locking
  • Verify CI/CD terraform apply is working without DynamoDB locking

Closes #6757

DynamoDB state locking is deprecated as of Terraform 1.7+. This migrates
all backend configurations to use S3 native locking via `use_lockfile = true`.

Changes:
- Updated all 43 .tfbackend files to use `use_lockfile = true` instead of
  `dynamodb_table`
- Made DynamoDB table creation optional in terraform-backend-s3 module
  via `enable_dynamodb_lock_table` variable (default: false)
- Set `enable_dynamodb_lock_table = true` in accounts/main.tf to continue
  managing the existing DynamoDB table (can be removed in a future PR)
- Updated module README with S3 native locking documentation

The existing DynamoDB table is preserved but no longer used for locking.
It can be manually deleted in a future cleanup once this migration is verified.

Closes #6757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate terraform from Dynamo locks to S3 locks

2 participants