71be2abd2e
- Terraform modules: VPC, EC2, RDS, S3, CloudFront, Route53, Lambda, IAM, Security Groups - Ansible playbooks for server configuration - Scripts: create-test-environment.sh, destroy-test-environment.sh, validate-environment.sh - Documentation: README, QUICKSTART, AGENTS - Jenkins pipeline for automated deployment - Jenkins pipeline for environment destruction
38 lines
1.2 KiB
Terraform
38 lines
1.2 KiB
Terraform
# Backend Bootstrap - Bucket S3 y DynamoDB para Estado Terraform
|
|
# ================================================================
|
|
# Ejecutar PRIMERO antes de terraform init:
|
|
# aws s3api create-bucket --bucket sacc4-terraform-state-test --region mx-central-1
|
|
# aws dynamodb create-table --table-name sacc4-terraform-locks-test \
|
|
# --attribute-definitions AttributeName=LockID,AttributeType=S \
|
|
# --key-schema AttributeName=LockID,KeyType=HASH \
|
|
# --billing-mode PAY_PER_REQUEST
|
|
|
|
resource "aws_s3_bucket" "terraform_state" {
|
|
bucket = "sacc4-terraform-state-${var.environment}"
|
|
}
|
|
|
|
resource "aws_s3_bucket_versioning" "terraform_state" {
|
|
bucket = aws_s3_bucket.terraform_state.id
|
|
versioning_configuration {
|
|
status = "Enabled"
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state" {
|
|
bucket = aws_s3_bucket.terraform_state.id
|
|
rule {
|
|
apply_server_side_encryption_by_default {
|
|
sse_algorithm = "AES256"
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "aws_dynamodb_table" "terraform_locks" {
|
|
name = "sacc4-terraform-locks-${var.environment}"
|
|
billing_mode = "PAY_PER_REQUEST"
|
|
hash_key = "LockID"
|
|
attribute {
|
|
name = "LockID"
|
|
type = "S"
|
|
}
|
|
} |