DeploymentGroup
The DeploymentGroup resource lets you manage AWS CodeDeploy DeploymentGroups for deploying applications across Amazon EC2 instances or other compute platforms.
Minimal Example
Section titled “Minimal Example”Create a basic deployment group with required properties and some common optional settings.
import AWS from "alchemy/aws/control";
const deploymentGroup = await AWS.CodeDeploy.DeploymentGroup("myDeploymentGroup", { ApplicationName: "MyApp", ServiceRoleArn: "arn:aws:iam::123456789012:role/CodeDeployRole", DeploymentConfigName: "CodeDeployDefault.AllAtOnce", Tags: [ { Key: "Environment", Value: "Production" } ], Ec2TagFilters: [ { Key: "Name", Value: "MyEC2Instance", Type: "KEY_AND_VALUE" } ]});
Advanced Configuration
Section titled “Advanced Configuration”Configure a deployment group with blue/green deployment settings and auto rollback capabilities.
const advancedDeploymentGroup = await AWS.CodeDeploy.DeploymentGroup("advancedDeploymentGroup", { ApplicationName: "MyAdvancedApp", ServiceRoleArn: "arn:aws:iam::123456789012:role/CodeDeployRole", DeploymentConfigName: "CodeDeployDefault.OneAtATime", BlueGreenDeploymentConfiguration: { TerminateBlueInstancesOnSuccess: { Action: "TERMINATE", WaitTimeInMinutes: 5 }, DeploymentReadyOption: { ActionOnTimeout: "CONTINUE_DEPLOYMENT" } }, AutoRollbackConfiguration: { Enabled: true, Events: ["DEPLOYMENT_FAILURE"] }});
Load Balancer Integration
Section titled “Load Balancer Integration”Create a deployment group integrated with an Elastic Load Balancer.
const loadBalancedDeploymentGroup = await AWS.CodeDeploy.DeploymentGroup("loadBalancedDeploymentGroup", { ApplicationName: "MyLoadBalancedApp", ServiceRoleArn: "arn:aws:iam::123456789012:role/CodeDeployRole", LoadBalancerInfo: { ElbInfoList: [ { Name: "my-load-balancer" } ] }, DeploymentConfigName: "CodeDeployDefault.HalfAtATime", ECSServices: [ { ClusterName: "my-cluster", ServiceName: "my-ecs-service" } ]});
On-Premises Deployment
Section titled “On-Premises Deployment”Set up a deployment group for on-premises instances with tagging.
const onPremisesDeploymentGroup = await AWS.CodeDeploy.DeploymentGroup("onPremisesDeploymentGroup", { ApplicationName: "MyOnPremisesApp", ServiceRoleArn: "arn:aws:iam::123456789012:role/CodeDeployRole", OnPremisesInstanceTagFilters: [ { Key: "Environment", Value: "Development", Type: "KEY_AND_VALUE" } ], DeploymentConfigName: "CodeDeployDefault.AllAtOnce", Tags: [ { Key: "Environment", Value: "Development" } ]});
This documentation provides a comprehensive overview of the AWS CodeDeploy DeploymentGroup resource, showcasing basic usage and advanced configurations to suit various deployment strategies.