This directory contains multiple options for setting up the required AWS backend resources (S3 bucket and DynamoDB table) for Terraform state management.
Requirements: AWS CLI installed and configured
cd agentguard-infrastructure
.\setup-backend.ps1Pros: Fully automated, fastest method Cons: Requires AWS CLI installation
Requirements: AWS CLI installed and configured
cd agentguard-infrastructure
chmod +x setup-backend.sh
./setup-backend.shPros: Fully automated, fastest method Cons: Requires AWS CLI installation
Requirements: AWS Console access only (no CLI needed)
Follow the detailed step-by-step instructions in: 📄 MANUAL_SETUP_INSTRUCTIONS.md
Pros: No CLI installation required, visual interface Cons: Manual steps, takes longer
Both methods create the following AWS resources:
- Name:
agentguard-terraform-state-<random-suffix> - Purpose: Store Terraform state file
- Features:
- ✓ Versioning enabled (state history)
- ✓ Server-side encryption (AES-256)
- ✓ Public access blocked
- ✓ Secure by default
- Name:
agentguard-terraform-state-lock - Purpose: State locking (prevent concurrent modifications)
- Features:
- ✓ Partition key:
LockID(String) - ✓ On-demand billing mode
- ✓ Encryption at rest
- ✓ Cost-optimized
- ✓ Partition key:
- S3 Bucket: < $0.10/month (state file is typically < 1 MB)
- DynamoDB Table: < $0.50/month (infrequent operations)
- Total: < $1.00/month
Once you've created the backend resources using any method above:
-
Update
backend.tfwith your bucket name and region:terraform { backend "s3" { bucket = "agentguard-terraform-state-<your-suffix>" key = "agentguard/terraform.tfstate" region = "us-east-1" dynamodb_table = "agentguard-terraform-state-lock" encrypt = true } }
-
Initialize Terraform:
terraform init
Testing Note: For comprehensive testing procedures and troubleshooting, see TERRAFORM_INIT_TESTING.md
-
Proceed with infrastructure deployment:
terraform plan terraform apply
- Windows: Download from https://awscli.amazonaws.com/AWSCLIV2.msi
- Linux/Mac: Follow instructions at https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- Alternative: Use Method 3 (AWS Console)
aws configureEnter your AWS Access Key ID, Secret Access Key, and default region.
S3 bucket names must be globally unique. The scripts use random suffixes, but if you encounter this error, try running the script again or manually specify a unique name.
- 📖 Detailed manual instructions: MANUAL_SETUP_INSTRUCTIONS.md
- 📖 Full setup guide: SETUP.md
- 📖 Design documentation: ../.kiro/specs/agentguard-infrastructure/design.md
- ✓ All resources are created with security best practices
- ✓ Encryption enabled by default
- ✓ Public access blocked
- ✓ Versioning enabled for state recovery
- ✓ State locking prevents concurrent modifications
After backend setup is complete, proceed to:
- Configure Terraform variables (
terraform.tfvars) - Deploy VPC infrastructure
- Deploy EKS cluster
- Deploy worker nodes
See SETUP.md for the complete deployment guide.