This repository contains Terraform files and shell scripts to create a new Amazon ECS (Elastic Container Service) environment within a new VPC (Virtual Private Cloud). These scripts automate the provisioning of AWS infrastructure for deploying containerized applications efficiently.
Follow the steps below to successfully create and deploy your ECS environment.
Before running the setup, ensure that the AWS CLI is installed and configured on your local machine.
-
Install AWS CLI: Follow the official AWS documentation to install the CLI:
👉 AWS CLI Installation Guide -
Provide Full Access to AWS IAM Role: provide the full access to IAM Role
-
Configure AWS Credentials: Once installed, configure your AWS credentials by following this guide:
👉 AWS CLI Authentication and Configuration
Execute the shell script to initiate the ECS setup:
/bin/bash run.sh <github-repo-name>
📌 What this script does:
- Runs a Python script in the backend to automate resource creation.
- Sets up AWS VPC, Subnet, Internet Gateway, ECR Repository, ECS Cluster, and ALB.
- Upon successful execution, the script returns the Application Load Balancer (ALB) URL, which is required to access the deployed application.
To deploy your application, create a new repository based on the Python-app boilerplate.
Make any new commit to the main branch of your repository. This will automatically trigger a GitHub Action that:
- Builds the Docker image of your application.
- Pushes the image to Amazon ECR (Elastic Container Registry).
- Deploys the application to Amazon ECS.
Once the deployment is successful, you can access your application using the ALB URL obtained in Step 2.
🔗 Application URL: http://<ALB-DNS-Name>
✅ Automated infrastructure provisioning using Terraform and shell scripts
✅ Secure and scalable ECS deployment in a new VPC
✅ Seamless GitHub Actions integration for CI/CD
✅ Easy application access via ALB URL
This setup ensures a smooth and automated deployment process for your Python-based containerized applications on AWS ECS. 🚀
For any issues or improvements, feel free to open an issue or contribute to this repository! 😊