Skip to content

Add Terraform state management with S3 backend and DynamoDB locking #396

Description

@FaveTeamz

Summary

Configure Terraform remote state storage using an S3 backend with DynamoDB state locking to prevent concurrent apply operations from corrupting infrastructure state.

Background

Terraform state is currently managed locally, making it impossible for multiple team members to safely apply changes or run CI-based plans. Remote state with locking is a prerequisite for team collaboration and CI automation.

Requirements

  • S3 bucket: workload-governor-tfstate with versioning enabled and public access blocked
  • DynamoDB table: workload-governor-tfstate-lock with LockID primary key
  • Backend configuration in terraform/main.tf using S3 backend
  • Separate state files per environment (staging, production) using S3 key prefix
  • State bucket encrypted with KMS key
  • Bootstrap script to create the S3 bucket and DynamoDB table (chicken-and-egg problem)

Acceptance Criteria

  • terraform init succeeds with S3 backend
  • Concurrent terraform apply is blocked by DynamoDB lock
  • State bucket has versioning and encryption enabled
  • Bootstrap script documented and idempotent
  • Staging and production use separate state files

References

  • terraform/main.tf
  • terraform/variables.tf

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdevopsCI/CD and infrastructure

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions