Skip to content
GitHubXDiscordRSS

DeploymentGroup

Learn how to create, update, and manage AWS CodeDeploy DeploymentGroups using Alchemy Cloud Control.

The DeploymentGroup resource lets you manage AWS CodeDeploy DeploymentGroups for deploying applications across Amazon EC2 instances or other compute platforms.

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"
}
]
});

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"]
}
});

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"
}
]
});

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.