https://github.com/chetanxpro/aws-backend-infrastructure
Terraform configuration for my backend infrastructure on AWS.
https://github.com/chetanxpro/aws-backend-infrastructure
aws infrastructure terraform
Last synced: 2 months ago
JSON representation
Terraform configuration for my backend infrastructure on AWS.
- Host: GitHub
- URL: https://github.com/chetanxpro/aws-backend-infrastructure
- Owner: ChetanXpro
- Created: 2024-09-14T18:22:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-20T09:25:05.000Z (over 1 year ago)
- Last Synced: 2025-03-16T07:11:34.504Z (over 1 year ago)
- Topics: aws, infrastructure, terraform
- Language: HCL
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: security.tf
Awesome Lists containing this project
README
# AWS Infrastructure with Terraform
Terraform configuration for my backend infrastructure on AWS.
## Prerequisites
- Terraform >= 1.9.2
- AWS CLI configured with appropriate permissions
- SSH key pair for EC2 access
## Setup
1. Clone the repository
2. Copy `terraform.tfvars.example` to `terraform.tfvars`
3. Update `terraform.tfvars` with your values:
- Set your AWS region and profile
- Update SSH key path
- Configure database credentials
- Set unique S3 bucket name
- Configure allowed IP ranges for SSH access
4. Run `terraform init` to initialize providers
5. Run `terraform plan` to preview changes
6. Run `terraform apply` to create infrastructure
## Infrastructure Components
- VPC with public subnets in multiple availability zones
- RDS PostgreSQL 16.3 database instance
- Private S3 bucket with CORS configuration
- EC2 instance for backend application
- Security groups for EC2 and RDS
- IAM roles for S3 access
## Important Notes
- The EC2 instance will have access to the S3 bucket via IAM role
- RDS is accessible only from the backend EC2 instance
- S3 bucket is private by default
- All resources are tagged with the instance name
## Clean Up
To destroy all created resources:
```bash
terraform destroy
```