This repository contains a collection of useful Terraform snippets designed to save time and simplify AWS infrastructure creation.
- Build terraform cli:
bin/build.sh- Define your AWS credentials:
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=XXX
export AWS_DEFAULT_REGION=us-east-1- Run terraform cli:
bin/run.sh- Go to any script and run it. Example:
cd aws/ec2
terraform init
terraform applyaws/ec2: launch an EC2 Instance.aws/s3: create an S3 bucket with versioning and encryption.aws/vpc: create a VPC with public and private subnets.aws/cloudwatch: launch AWS EC2 instance with CloudWatch monitoring.aws/eks: create an EKS cluster with autoscaler.aws/cloudfront: deploy a CloudFront CDN for an S3 Static Site.aws/cloudtrail: enable CloudTrail for auditing.aws/secrets: create a secret in Secrets Manager.aws/rds: create a PostgreSQL instance with public access.aws/ecs: create an ECS cluster with Fargate.