In this demo, we will:
CodeDeploy
CodeDeployServiceRole
AmazonEC2RoleforAWSCodeDeploy
AmazonS3ReadOnlyAccess
EC2CodeDeployRole
CodeDeploy-Demo-Instance-1
Environment
Demo
codedeploy-key-pair
#!/bin/bash
yum update -y
yum install -y ruby wget httpd
cd /home/ec2-user
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install
chmod +x ./install
./install auto
systemctl start codedeploy-agent
systemctl enable codedeploy-agent
systemctl start httpd
systemctl enable httpd
CodeDeploy-Demo-Instance-2
Environment
Demo
#!/bin/bash
yum update -y
yum install -y ruby wget httpd
cd /home/ec2-user
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install
chmod +x ./install
./install auto
systemctl start codedeploy-agent
systemctl enable codedeploy-agent
systemctl start httpd
systemctl enable httpd
MyWebApp
MyWebApp-DeploymentGroup
Choose this
Environment
Demo
chmod +X scripts/*.sh
codedeploy-demo-bucket-012931
cd ..
zip -r mywebapp-v1.zip my-web-app/
s3://codedeploy-demo-bucket-012931/mywebapp-v1.zip
http://3.82.146.251
http://44.202.11.142
#ffe0f0
zip -r mywebapp-v2.zip my-web-app/
s3://codedeploy-demo-bucket-012931/mywebapp-v2.zip
http://3.82.146.251
http://44.202.11.142
permanently delete
CodeDeployServiceRole
EC2CodeDeployRole