This project uses the AWS Strands Agent to orchestrate an AI-powered workflow for generating and deploying a Single Page Application (SPA) website. The agent automates the entire process:
- Generate HTML
- Generate Dockerfile & Nginx configuration
- Build and push Docker image to AWS ECR
- Generate Terraform configuration
- Deploy the application to AWS ECS
Note
This application did not work on Windows.
Before you run this project, make sure you have installed and configured the following:
- Python
3.10.18 - uv Python package manager
- Docker
- Terraform
- AWS CLI configured with:
- AWS Access Key ID
- AWS Secret Access Key
- Bedrock Model
- IAM user permissions to:
- Create and push ECR repositories
- Provision ECS resources
- Create VPC, Load Balancer, IAM Roles, and other infrastructure
-
Clone the repository
git clone https://github.com/fromhell13/spa-web-builder-agent.git cd spa-web-builder-agent -
Install dependencies
uv sync
-
Activate Virtual Environment
source .venv/bin/activate -
Configure AWS credentials
You can export them in your shell or configure them using
aws configure:export AWS_ACCESS_KEY_ID=your-access-key export AWS_SECRET_ACCESS_KEY=your-secret-key export AWS_DEFAULT_REGION=your-region
Note
If you want to bypass tool consent, you can run export BYPASS_TOOL_CONSENT=true
-
Environment Configuration
Rename .env.sample file to .env and fill up environment variable with your own data
AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= AWS_ACCOUNT_ID= REPO_NAME= IMAGE_NAME=
-
Run the Agent Workflow
uv run main.py
- Docker: Ensure Docker is running locally to build and push images.
- IAM Permissions: You need permissions for ECS, ECR, IAM, VPC, and related services.
- Region: Confirm your AWS region matches your ECR and ECS configuration.
Warning
Run terraform destroy to avoid AWS cost in your AWS account
