Creating a simple AWS infrastructure using IaC Terraform to deploy a basic web application. Utilizing Amazon EFS to store the HTML page content and Amazon ECS for containerized deployment.
Before starting the deployment, ensure you have the following:
- AWS CLI installed and configured (aws configure)
- Terraform installed (terraform -v)
- Docker installed for local testing (docker -v)
tf-infrastructure-setup/
│
├── modules/
│ ├── alb/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ │
│ ├── ecs/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ │
│ └── efs/
│ ├── main.tf
│ ├── variables.tf
│ └── outputs.tf
│
├── main.tf
├── variables.tf
├── outputs.tf
├── terraform.tfvars
└── index.html
git clone https://github.com/Losiev/tf-infrastructure-setup.git
docker compose up -d
Connect via:
http:/localhost:80/
You can stop container using:
docker compose down
cd terraform
terraform init
terraform plan
terraform apply
http://<alb_dns_name>:80
To remove all deployed resources:
terraform destroy -auto-approve

