- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateDeploymentGroupCommand
Changes information about a deployment group.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeDeployClient, UpdateDeploymentGroupCommand } from "@aws-sdk/client-codedeploy"; // ES Modules import
// const { CodeDeployClient, UpdateDeploymentGroupCommand } = require("@aws-sdk/client-codedeploy"); // CommonJS import
const client = new CodeDeployClient(config);
const input = { // UpdateDeploymentGroupInput
applicationName: "STRING_VALUE", // required
currentDeploymentGroupName: "STRING_VALUE", // required
newDeploymentGroupName: "STRING_VALUE",
deploymentConfigName: "STRING_VALUE",
ec2TagFilters: [ // EC2TagFilterList
{ // EC2TagFilter
Key: "STRING_VALUE",
Value: "STRING_VALUE",
Type: "KEY_ONLY" || "VALUE_ONLY" || "KEY_AND_VALUE",
},
],
onPremisesInstanceTagFilters: [ // TagFilterList
{ // TagFilter
Key: "STRING_VALUE",
Value: "STRING_VALUE",
Type: "KEY_ONLY" || "VALUE_ONLY" || "KEY_AND_VALUE",
},
],
autoScalingGroups: [ // AutoScalingGroupNameList
"STRING_VALUE",
],
serviceRoleArn: "STRING_VALUE",
triggerConfigurations: [ // TriggerConfigList
{ // TriggerConfig
triggerName: "STRING_VALUE",
triggerTargetArn: "STRING_VALUE",
triggerEvents: [ // TriggerEventTypeList
"DeploymentStart" || "DeploymentSuccess" || "DeploymentFailure" || "DeploymentStop" || "DeploymentRollback" || "DeploymentReady" || "InstanceStart" || "InstanceSuccess" || "InstanceFailure" || "InstanceReady",
],
},
],
alarmConfiguration: { // AlarmConfiguration
enabled: true || false,
ignorePollAlarmFailure: true || false,
alarms: [ // AlarmList
{ // Alarm
name: "STRING_VALUE",
},
],
},
autoRollbackConfiguration: { // AutoRollbackConfiguration
enabled: true || false,
events: [ // AutoRollbackEventsList
"DEPLOYMENT_FAILURE" || "DEPLOYMENT_STOP_ON_ALARM" || "DEPLOYMENT_STOP_ON_REQUEST",
],
},
outdatedInstancesStrategy: "UPDATE" || "IGNORE",
deploymentStyle: { // DeploymentStyle
deploymentType: "IN_PLACE" || "BLUE_GREEN",
deploymentOption: "WITH_TRAFFIC_CONTROL" || "WITHOUT_TRAFFIC_CONTROL",
},
blueGreenDeploymentConfiguration: { // BlueGreenDeploymentConfiguration
terminateBlueInstancesOnDeploymentSuccess: { // BlueInstanceTerminationOption
action: "TERMINATE" || "KEEP_ALIVE",
terminationWaitTimeInMinutes: Number("int"),
},
deploymentReadyOption: { // DeploymentReadyOption
actionOnTimeout: "CONTINUE_DEPLOYMENT" || "STOP_DEPLOYMENT",
waitTimeInMinutes: Number("int"),
},
greenFleetProvisioningOption: { // GreenFleetProvisioningOption
action: "DISCOVER_EXISTING" || "COPY_AUTO_SCALING_GROUP",
},
},
loadBalancerInfo: { // LoadBalancerInfo
elbInfoList: [ // ELBInfoList
{ // ELBInfo
name: "STRING_VALUE",
},
],
targetGroupInfoList: [ // TargetGroupInfoList
{ // TargetGroupInfo
name: "STRING_VALUE",
},
],
targetGroupPairInfoList: [ // TargetGroupPairInfoList
{ // TargetGroupPairInfo
targetGroups: [
{
name: "STRING_VALUE",
},
],
prodTrafficRoute: { // TrafficRoute
listenerArns: [ // ListenerArnList
"STRING_VALUE",
],
},
testTrafficRoute: {
listenerArns: [
"STRING_VALUE",
],
},
},
],
},
ec2TagSet: { // EC2TagSet
ec2TagSetList: [ // EC2TagSetList
[
{
Key: "STRING_VALUE",
Value: "STRING_VALUE",
Type: "KEY_ONLY" || "VALUE_ONLY" || "KEY_AND_VALUE",
},
],
],
},
ecsServices: [ // ECSServiceList
{ // ECSService
serviceName: "STRING_VALUE",
clusterName: "STRING_VALUE",
},
],
onPremisesTagSet: { // OnPremisesTagSet
onPremisesTagSetList: [ // OnPremisesTagSetList
[
{
Key: "STRING_VALUE",
Value: "STRING_VALUE",
Type: "KEY_ONLY" || "VALUE_ONLY" || "KEY_AND_VALUE",
},
],
],
},
terminationHookEnabled: true || false,
};
const command = new UpdateDeploymentGroupCommand(input);
const response = await client.send(command);
// { // UpdateDeploymentGroupOutput
// hooksNotCleanedUp: [ // AutoScalingGroupList
// { // AutoScalingGroup
// name: "STRING_VALUE",
// hook: "STRING_VALUE",
// terminationHook: "STRING_VALUE",
// },
// ],
// };
UpdateDeploymentGroupCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
applicationName Required | string | undefined | The application name that corresponds to the deployment group to update. |
currentDeploymentGroupName Required | string | undefined | The current name of the deployment group. |
alarmConfiguration | AlarmConfiguration | undefined | Information to add or change about Amazon CloudWatch alarms when the deployment group is updated. |
autoRollbackConfiguration | AutoRollbackConfiguration | undefined | Information for an automatic rollback configuration that is added or changed when a deployment group is updated. |
autoScalingGroups | string[] | undefined | The replacement list of Auto Scaling groups to be included in the deployment group, if you want to change them.
|
blueGreenDeploymentConfiguration | BlueGreenDeploymentConfiguration | undefined | Information about blue/green deployment options for a deployment group. |
deploymentConfigName | string | undefined | The replacement deployment configuration name to use, if you want to change it. |
deploymentStyle | DeploymentStyle | undefined | Information about the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer. |
ec2TagFilters | EC2TagFilter[] | undefined | The replacement set of Amazon EC2 tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names. |
ec2TagSet | EC2TagSet | undefined | Information about groups of tags applied to on-premises instances. The deployment group includes only Amazon EC2 instances identified by all the tag groups. |
ecsServices | ECSService[] | undefined | The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name pair using the format |
loadBalancerInfo | LoadBalancerInfo | undefined | Information about the load balancer used in a deployment. |
newDeploymentGroupName | string | undefined | The new name of the deployment group, if you want to change it. |
onPremisesInstanceTagFilters | TagFilter[] | undefined | The replacement set of on-premises instance tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names. |
onPremisesTagSet | OnPremisesTagSet | undefined | Information about an on-premises instance tag set. The deployment group includes only on-premises instances identified by all the tag groups. |
outdatedInstancesStrategy | OutdatedInstancesStrategy | undefined | Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. If this option is set to If this option is set to |
serviceRoleArn | string | undefined | A replacement ARN for the service role, if you want to change it. |
terminationHookEnabled | boolean | undefined | This parameter only applies if you are using CodeDeploy with Amazon EC2 Auto Scaling. For more information, see Integrating CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User Guide. Set For information about termination deployments, see Enabling termination deployments during Auto Scaling scale-in events in the CodeDeploy User Guide. For more information about Auto Scaling scale-in events, see the Scale in topic in the Amazon EC2 Auto Scaling User Guide. |
triggerConfigurations | TriggerConfig[] | undefined | Information about triggers to change when the deployment group is updated. For examples, see Edit a Trigger in a CodeDeploy Deployment Group in the CodeDeploy User Guide. |
UpdateDeploymentGroupCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
hooksNotCleanedUp | AutoScalingGroup[] | undefined | If the output contains no data, and the corresponding deployment group contained at least one Auto Scaling group, CodeDeploy successfully removed all corresponding Auto Scaling lifecycle event hooks from the Amazon Web Services account. If the output contains data, CodeDeploy could not remove some Auto Scaling lifecycle event hooks from the Amazon Web Services account. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AlarmsLimitExceededException | client | The maximum number of alarms for a deployment group (10) was exceeded. |
ApplicationDoesNotExistException | client | The application does not exist with the user or Amazon Web Services account. |
ApplicationNameRequiredException | client | The minimum number of required application names was not specified. |
DeploymentConfigDoesNotExistException | client | The deployment configuration does not exist with the user or Amazon Web Services account. |
DeploymentGroupAlreadyExistsException | client | A deployment group with the specified name with the user or Amazon Web Services account already exists. |
DeploymentGroupDoesNotExistException | client | The named deployment group with the user or Amazon Web Services account does not exist. |
DeploymentGroupNameRequiredException | client | The deployment group name was not specified. |
ECSServiceMappingLimitExceededException | client | The Amazon ECS service is associated with more than one deployment groups. An Amazon ECS service can be associated with only one deployment group. |
InvalidAlarmConfigException | client | The format of the alarm configuration is invalid. Possible causes include:
|
InvalidApplicationNameException | client | The application name was specified in an invalid format. |
InvalidAutoRollbackConfigException | client | The automatic rollback configuration was specified in an invalid format. For example, automatic rollback is enabled, but an invalid triggering event type or no event types were listed. |
InvalidAutoScalingGroupException | client | The Auto Scaling group was specified in an invalid format or does not exist. |
InvalidBlueGreenDeploymentConfigurationException | client | The configuration for the blue/green deployment group was provided in an invalid format. For information about deployment configuration format, see CreateDeploymentConfig. |
InvalidDeploymentConfigNameException | client | The deployment configuration name was specified in an invalid format. |
InvalidDeploymentGroupNameException | client | The deployment group name was specified in an invalid format. |
InvalidDeploymentStyleException | client | An invalid deployment style was specified. Valid deployment types include "IN_PLACE" and "BLUE_GREEN." Valid deployment options include "WITH_TRAFFIC_CONTROL" and "WITHOUT_TRAFFIC_CONTROL." |
InvalidEC2TagCombinationException | client | A call was submitted that specified both Ec2TagFilters and Ec2TagSet, but only one of these data types can be used in a single call. |
InvalidEC2TagException | client | The tag was specified in an invalid format. |
InvalidECSServiceException | client | The Amazon ECS service identifier is not valid. |
InvalidInputException | client | The input was specified in an invalid format. |
InvalidLoadBalancerInfoException | client | An invalid load balancer name, or no load balancer name, was specified. |
InvalidOnPremisesTagCombinationException | client | A call was submitted that specified both OnPremisesTagFilters and OnPremisesTagSet, but only one of these data types can be used in a single call. |
InvalidRoleException | client | The service role ARN was specified in an invalid format. Or, if an Auto Scaling group was specified, the specified service role does not grant the appropriate permissions to Amazon EC2 Auto Scaling. |
InvalidTagException | client | The tag was specified in an invalid format. |
InvalidTargetGroupPairException | client | A target group pair associated with this deployment is not valid. |
InvalidTrafficRoutingConfigurationException | client | The configuration that specifies how traffic is routed during a deployment is invalid. |
InvalidTriggerConfigException | client | The trigger was specified in an invalid format. |
LifecycleHookLimitExceededException | client | The limit for lifecycle hooks was exceeded. |
TagSetListLimitExceededException | client | The number of tag groups included in the tag set list exceeded the maximum allowed limit of 3. |
ThrottlingException | client | An API function was called too frequently. |
TriggerTargetsLimitExceededException | client | The maximum allowed number of triggers was exceeded. |
CodeDeployServiceException | Base exception class for all service exceptions from CodeDeploy service. |