Terraform AWS RDS and ElastiCache provisioning

12060
0

Terraform provisions managed database services declaratively. AWS RDS supports PostgreSQL, MySQL, and other engines with aws_db_instance. The engine_version pins database versions. instance_class sets compute size. allocated_storage and max_allocated_storage enable auto-scaling. multi_az provides high availability with automatic failover. Subnet groups place databases in private subnets. Parameter groups customize database settings. Security groups restrict access to application subnets only. ElastiCache provides managed Redis or Memcached with aws_elasticache_cluster or aws_elasticache_replication_group for Redis cluster mode. Automated backups, encryption at rest with KMS, and encryption in transit with TLS protect data. Always store connection strings in Secrets Manager.