AWS Code Deploy
- Services that deploy to any AWS EC2 instances or running on-premises instances
- Helps Rapidly release new features
- Helps avoid in downtime during application deployment
- It will also automate software deployments
Architecture of AWS code deploy
- User/Employee can push the code to AWS code deploy service
- AWS code Deploy service will invoke the trigger to single or multiple EC2 instances based on the configuration.
- EC2 instances will be pushing the changes to either to the Github repository/AWS s3 , depends on configuration made in the EC2 instances.
- From Repository/S3, it will reach for testing /releasing the code/SW depends on the configurations.
We can configure agents on EC2 instances based on the application versions.
Lets see, How we can see the code deployment service will be implemented and used for code deploy.
Configure AWS EC2 instance to work with "Code deploy service"
sudo yum update
sudo yum install ruby
sudo yum install wget
cd /home/ec2-user
wget https://was-codedeploy-$REGION.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
Push your project to your github by using simple git commands
IAM Roles
Create the following IAM roles and attach the policies
- IAM role for Instance profile
- IAM role for Service profile
Instance Role:
CodeDeployInstance Role:Attach following policies
AmazonEC2RoleforCodedeploy: this will allow EC2 to access S3.
AutoScalingNotificationAccessRole: It will allow EC2 to access SQS,SNS
CodeDeployServiceRole
Attach following roles
AWSCodedeployrole: This will allow codedeploy service access to autoscaling/EC2/SNS
Note: Edit trust relationship to ensure
Service="codedeploy.amazonaws.com"
Userdata for codedeploy to EC2 instance
No comments:
Post a Comment