AWS CodeDeploy automates application deployments across Amazon EC2 instances, on-premises servers, and serverless environments such as AWS Lambda. By integrating AWS CodeDeploy with Elastigroup, users can optimize deployment resources while ensuring high availability and minimal downtime. This article explains how to create a CodeDeploy application and connect it to Elastigroup using the Blue/Green deployment model.
Create the CodeDeploy application
-
Sign in to the AWS Management Console and navigate to CodeDeploy → Applications → Create Application.
-
Enter a name for your application.
-
Choose EC2/On-premises as the compute platform.
-
Click Create Application.
Create a deployment group
-
Inside your application, select Create Deployment Group.
-
Specify a Deployment group name.
-
Assign the IAM service role used for CodeDeploy (for example:
arn:aws:iam::372573644578:role/CodeDeployServiceRole). -
Under Deployment type, select In-place for the initial setup.
Launch an EC2 instance and install the CodeDeploy agent
-
Navigate to EC2 → Instances → Launch Instances.
-
Choose an Amazon Linux AMI and configure instance details, including VPC, subnet, and IAM instance profile (
CodeDeployInstanceRole). -
In the User data field, add the following script to install the CodeDeploy agent:
#!/bin/bash # Update system packages yum update -y # Install Ruby yum install -y ruby # Install wget yum install -y wget # Download CodeDeploy Installer wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install # Make installer executable chmod +x ./install # Install CodeDeploy Agent ./install auto # Start CodeDeploy Agent service codedeploy-agent start # Check status service codedeploy-agent status -
Launch the instance and verify agent installation with:
sudo service codedeploy-agent status
Deploy the application
-
In the CodeDeploy console, go to your Deployment group.
-
Choose Create Deployment.
-
Under Revision type, select My application is stored in Amazon S3.
-
Specify the revision location (for example:
s3://aws-codedeploy-us-west-2/samples/latest/SampleApp_Linux.zip). -
Leave default options and select Create Deployment.
-
Wait for the deployment process to complete.
Verify deployment success
After deployment, confirm that the demo application is running by copying the public DNS address of the EC2 instance and opening it in your web browser.
Enable Blue/Green deployment
-
In CodeDeploy, open your deployment group and click Edit.
-
Change the Deployment type to Blue/green.
-
Save the changes.
Connect CodeDeploy to Elastigroup
-
In the Elastigroup console, create a new group using the CodeDeploy use case.
-
Assign a group name and region matching your CodeDeploy application.
-
In the Compute configuration, select the same VPC, subnets, and security groups as your EC2 instance.
-
In Additional Configurations, paste the same user data script from section 3 above.
-
Under Integrations, select your CodeDeploy application and deployment group.
-
Configure CodeDeploy integration options:
-
Clean on Failure: Determines whether to remove temporary deployment groups after failure.
-
Terminate Instance on Failure: Determines whether to terminate failed instances.
-
Attach a load balancer (optional)
If using Blue/Green deployment, attach an Application Load Balancer (ALB) with listeners on ports 80 and 443.
Outcome
The Elastigroup integrated with CodeDeploy is now prepared for Blue/Green deployments. Elastigroup provisions new instances tagged as “green,” integrates them with the AWS CodeDeploy process, and detaches the old “blue” instances once the update is successful.
Related Articles
Create a scaling policy that uses the latency metric 20Number of Views Create a Shortcut on the Quick Launch Bar 6Number of Views Snow create recognition request (DIS) form 174Number of Views Unable to Connect to AWS Redshift 10Number of Views Create 64bit Non-Managed Code Application 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add additional feedback (optional)
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
|
FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513
(toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367
(toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895
2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago