Chaos Engineering
Introduction to Real life Application
Pre requisite to Deploy Application Cloud 9 Deprecation
In this lesson, you’ll provision an EC2-based development environment with all the tools required to deploy our pet adoption website using the AWS Cloud Development Kit (CDK). We’ll cover:
- Manual setup of an EC2 instance
- Automating that setup with a CloudFormation template
- Alternatives to the deprecated AWS Cloud9 environment
1. Create the IAM Role
First, create an IAM role named FIS-workshop-admin with the following managed policies:
Policy Name | Purpose |
---|---|
AmazonEC2FullAccess | Full control of EC2 resources |
AmazonSSMManagedInstanceCore | Systems Manager Session Manager permissions |
Warning
The role name must be exactly FIS-workshop-admin
. All subsequent CDK and CloudFormation scripts expect this exact name.
2. Launch and Configure the EC2 Instance
When launching your EC2 instance:
- Attach the FIS-workshop-admin IAM role
- Choose an instance type (e.g.,
t3.medium
) - Select your VPC and subnets
- Enable SSH access or plan to use AWS Systems Manager Session Manager
3. Connect & Prepare Your Environment
Once your instance is up:
# Update the OS
sudo yum update -y
# Install Git
sudo yum install -y git
Clone the workshop repository and bootstrap the environment:
git clone https://github.com/aws-samples/fis-workshop-experiments.git
cd fis-workshop-experiments
# Install Docker, kubectl, Node.js, AWS CDK, and other dependencies
bash bootstrap.sh
This script installs:
- Docker Engine
- Kubernetes CLI tools (
kubectl
,eksctl
) - Node.js and npm
- AWS CDK Toolkit (
npm install -g aws-cdk
)
4. Automate with CloudFormation (Optional)
Skip steps 1–2 by deploying our CloudFormation template. It creates both the IAM role and EC2 instance in one stack:
aws cloudformation deploy \
--template-file infrastructure/dev-environment.yaml \
--stack-name fis-workshop-dev \
--capabilities CAPABILITY_NAMED_IAM
Cloud9 Deprecation & Alternative IDEs
AWS no longer provides preconfigured Cloud9 environments for new accounts as of July 2024. You can continue with your custom Cloud9 IDE, or choose one of these alternatives:
All scripts and detailed instructions are available in the fis-workshop-experiments GitHub repository.
References
- AWS CDK Documentation
- AWS CloudFormation User Guide
- AWS Systems Manager Session Manager
- AWS EC2 Documentation
Watch Video
Watch video content