This repository documents my work for the AWS Academy Cloud Architecting – Challenge Lab: Automating Infrastructure Deployment. The lab demonstrates how to transition from manual AWS configuration to a fully automated Infrastructure as Code (IaC) and CI/CD workflow using AWS-native tools.
The café team wants to scale their web presence across multiple AWS Regions and maintain consistent development and production environments. To achieve this, the deployment process is automated using:
- AWS CloudFormation
- AWS CodeCommit
- AWS CodePipeline
- AWS Command Line Interface (CLI)
- Amazon EC2 / S3 / VPC
This lab walks through building:
- A static S3 website
- A VPC (network layer) using IaC
- A dynamic EC2-based café application
- A full CI/CD workflow for automated stack deployment
- Multi-Region duplication of both network and app stacks
- Write a CloudFormation template from scratch
- Create an S3 bucket via AWS CLI
- Enable static website hosting
- Upload web assets programmatically
- Update the CloudFormation stack
- Add Outputs (website URL)
- Clone a CodeCommit repository
- Push CloudFormation templates
- Track version history
Two AWS pipelines were used:
Creates:
- VPC
- Public Subnet
- Routing resources
- Security group
- Exported Outputs (SubnetId, VPCId)
Creates:
- EC2 instance with Apache, MariaDB & PHP
- Security group
- Automatically installs the dynamic café application
- Outputs the public IP of the web server
- Recreate the network stack via CLI (us-west-2)
- Create Region-specific EC2 key pairs
- Deploy the application stack using the same template
- Verify that the application runs in multiple Regions
- 1× VPC
- 1× Public Subnet
- Internet Gateway
- Route Table + Route
- Security Group
- Amazon Linux 2 EC2 instance
- LAMP stack installed via UserData
- PHP app deployment via S3 script
- Public IP exposed for web access
- Developer updates a CloudFormation template
- Runs
git add,git commit,git push - CodeCommit receives the commit
- CodePipeline automatically triggers
- CloudFormation deploys/updates the stack
- EC2 launches + installs app automatically
This mirrors a real-world DevOps pipeline.
aws cloudformation create-stack --stack-name CreateBucket --template-body file://S3.yamlaws cloudformation update-stack --stack-name CreateBucket --template-body file://S3.yamlaws cloudformation validate-template --template-body file://S3.yamlgit add .
git commit -m "update template"
git pushDeploy network stack in Oregon:
aws cloudformation create-stack \
--stack-name update-cafe-network \
--template-body file:///home/ec2-user/environment/CFTemplatesRepo/templates/cafe-network.yaml \
--region us-west-2Upload app template to S3, then create stack via console using the S3 URL.
- Infrastructure as Code (IaC)
- CloudFormation template authoring
- VPC architecture
- CI/CD with CodeCommit & CodePipeline
- Linux UserData automation
- EC2 management
- S3 static hosting
- Cross-stack references (Outputs and ImportValue)
- Multi-Region architecture
- Git workflows
- AWS CLI automation
This challenge lab shows how CloudFormation and CI/CD fully transform deployment workflows. Using automation enables:
- Consistent deployments
- Faster environment provisioning
- Easier multi-Region scaling
- Better DevOps practices
- Stronger disaster recovery readiness
The final outcome is a fully automated, multi-Region café application deployed entirely through Infrastructure as Code.