CodeDeploy.Client.
create_deployment_group
(**kwargs)¶Creates a deployment group to which application revisions are deployed.
See also: AWS API Documentation
Request Syntax
response = client.create_deployment_group(
applicationName='string',
deploymentGroupName='string',
deploymentConfigName='string',
ec2TagFilters=[
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
onPremisesInstanceTagFilters=[
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
autoScalingGroups=[
'string',
],
serviceRoleArn='string',
triggerConfigurations=[
{
'triggerName': 'string',
'triggerTargetArn': 'string',
'triggerEvents': [
'DeploymentStart'|'DeploymentSuccess'|'DeploymentFailure'|'DeploymentStop'|'DeploymentRollback'|'DeploymentReady'|'InstanceStart'|'InstanceSuccess'|'InstanceFailure'|'InstanceReady',
]
},
],
alarmConfiguration={
'enabled': True|False,
'ignorePollAlarmFailure': True|False,
'alarms': [
{
'name': 'string'
},
]
},
autoRollbackConfiguration={
'enabled': True|False,
'events': [
'DEPLOYMENT_FAILURE'|'DEPLOYMENT_STOP_ON_ALARM'|'DEPLOYMENT_STOP_ON_REQUEST',
]
},
outdatedInstancesStrategy='UPDATE'|'IGNORE',
deploymentStyle={
'deploymentType': 'IN_PLACE'|'BLUE_GREEN',
'deploymentOption': 'WITH_TRAFFIC_CONTROL'|'WITHOUT_TRAFFIC_CONTROL'
},
blueGreenDeploymentConfiguration={
'terminateBlueInstancesOnDeploymentSuccess': {
'action': 'TERMINATE'|'KEEP_ALIVE',
'terminationWaitTimeInMinutes': 123
},
'deploymentReadyOption': {
'actionOnTimeout': 'CONTINUE_DEPLOYMENT'|'STOP_DEPLOYMENT',
'waitTimeInMinutes': 123
},
'greenFleetProvisioningOption': {
'action': 'DISCOVER_EXISTING'|'COPY_AUTO_SCALING_GROUP'
}
},
loadBalancerInfo={
'elbInfoList': [
{
'name': 'string'
},
],
'targetGroupInfoList': [
{
'name': 'string'
},
],
'targetGroupPairInfoList': [
{
'targetGroups': [
{
'name': 'string'
},
],
'prodTrafficRoute': {
'listenerArns': [
'string',
]
},
'testTrafficRoute': {
'listenerArns': [
'string',
]
}
},
]
},
ec2TagSet={
'ec2TagSetList': [
[
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
]
},
ecsServices=[
{
'serviceName': 'string',
'clusterName': 'string'
},
],
onPremisesTagSet={
'onPremisesTagSetList': [
[
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
]
},
tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of an CodeDeploy application associated with the IAM user or Amazon Web Services account.
[REQUIRED]
The name of a new deployment group for the specified application.
If specified, the deployment configuration name can be either one of the predefined configurations provided with CodeDeploy or a custom deployment configuration that you create by calling the create deployment configuration operation.
CodeDeployDefault.OneAtATime
is the default deployment configuration. It is used if a configuration isn't specified for the deployment or deployment group.
For more information about the predefined deployment configurations in CodeDeploy, see Working with Deployment Configurations in CodeDeploy in the CodeDeploy User Guide .
The Amazon EC2 tags on which to filter. The deployment group includes Amazon EC2 instances with any of the specified tags. Cannot be used in the same call as ec2TagSet.
Information about an EC2 tag filter.
The tag filter key.
The tag filter value.
The tag filter type:
KEY_ONLY
: Key only.VALUE_ONLY
: Value only.KEY_AND_VALUE
: Key and value.The on-premises instance tags on which to filter. The deployment group includes on-premises instances with any of the specified tags. Cannot be used in the same call as OnPremisesTagSet
.
Information about an on-premises instance tag filter.
The on-premises instance tag filter key.
The on-premises instance tag filter value.
The on-premises instance tag filter type:
A list of associated Amazon EC2 Auto Scaling groups.
[REQUIRED]
A service role Amazon Resource Name (ARN) that allows CodeDeploy to act on the user's behalf when interacting with Amazon Web Services services.
Information about triggers to create when the deployment group is created. For examples, see Create a Trigger for an CodeDeploy Event in the CodeDeploy User Guide .
Information about notification triggers for the deployment group.
The name of the notification trigger.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic through which notifications about deployment or instance events are sent.
The event type or types for which notifications are triggered.
Information to add about Amazon CloudWatch alarms when the deployment group is created.
Indicates whether the alarm configuration is enabled.
Indicates whether a deployment should continue if information about the current state of alarms cannot be retrieved from Amazon CloudWatch. The default value is false.
true
: The deployment proceeds even if alarm status information can't be retrieved from Amazon CloudWatch.false
: The deployment stops if alarm status information can't be retrieved from Amazon CloudWatch.A list of alarms configured for the deployment or deployment group. A maximum of 10 alarms can be added.
Information about an alarm.
The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.
Configuration information for an automatic rollback that is added when a deployment group is created.
Indicates whether a defined automatic rollback configuration is currently enabled.
The event type or types that trigger a rollback.
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 UPDATE
or is unspecified, CodeDeploy initiates one or more 'auto-update outdated instances' deployments to apply the deployed application revision to the new Amazon EC2 instances.
If this option is set to IGNORE
, CodeDeploy does not initiate a deployment to update the new Amazon EC2 instances. This may result in instances having different revisions.
Information about the type of deployment, in-place or blue/green, that you want to run and whether to route deployment traffic behind a load balancer.
Indicates whether to run an in-place deployment or a blue/green deployment.
Indicates whether to route deployment traffic behind a load balancer.
Information about blue/green deployment options for a deployment group.
Information about whether to terminate instances in the original fleet during a blue/green deployment.
The action to take on instances in the original environment after a successful blue/green deployment.
TERMINATE
: Instances are terminated after a specified wait time.KEEP_ALIVE
: Instances are left running after they are deregistered from the load balancer and removed from the deployment group.For an Amazon EC2 deployment, the number of minutes to wait after a successful blue/green deployment before terminating instances from the original environment.
For an Amazon ECS deployment, the number of minutes before deleting the original (blue) task set. During an Amazon ECS deployment, CodeDeploy shifts traffic from the original (blue) task set to a replacement (green) task set.
The maximum setting is 2880 minutes (2 days).
Information about the action to take when newly provisioned instances are ready to receive traffic in a blue/green deployment.
Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.
The number of minutes to wait before the status of a blue/green deployment is changed to Stopped if rerouting is not started manually. Applies only to the STOP_DEPLOYMENT
option for actionOnTimeout
.
Information about how instances are provisioned for a replacement environment in a blue/green deployment.
The method used to add instances to a replacement environment.
DISCOVER_EXISTING
: Use instances that already exist or will be created manually.COPY_AUTO_SCALING_GROUP
: Use settings from a specified Auto Scaling group to define and create instances in a new Auto Scaling group.Information about the load balancer used in a deployment.
An array that contains information about the load balancer to use for load balancing in a deployment. In Elastic Load Balancing, load balancers are used with Classic Load Balancers.
Note
Adding more than one load balancer to the array is not supported.
Information about a load balancer in Elastic Load Balancing to use in a deployment. Instances are registered directly with a load balancer, and traffic is routed to the load balancer.
For blue/green deployments, the name of the load balancer that is used to route traffic from original instances to replacement instances in a blue/green deployment. For in-place deployments, the name of the load balancer that instances are deregistered from so they are not serving traffic during a deployment, and then re-registered with after the deployment is complete.
An array that contains information about the target group to use for load balancing in a deployment. In Elastic Load Balancing, target groups are used with Application Load Balancers.
Note
Adding more than one target group to the array is not supported.
Information about a target group in Elastic Load Balancing to use in a deployment. Instances are registered as targets in a target group, and traffic is routed to the target group.
For blue/green deployments, the name of the target group that instances in the original environment are deregistered from, and instances in the replacement environment are registered with. For in-place deployments, the name of the target group that instances are deregistered from, so they are not serving traffic during a deployment, and then re-registered with after the deployment is complete.
The target group pair information. This is an array of TargeGroupPairInfo
objects with a maximum size of one.
Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.
One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.
Information about a target group in Elastic Load Balancing to use in a deployment. Instances are registered as targets in a target group, and traffic is routed to the target group.
For blue/green deployments, the name of the target group that instances in the original environment are deregistered from, and instances in the replacement environment are registered with. For in-place deployments, the name of the target group that instances are deregistered from, so they are not serving traffic during a deployment, and then re-registered with after the deployment is complete.
The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.
The Amazon Resource Name (ARN) of one listener. The listener identifies the route between a target group and a load balancer. This is an array of strings with a maximum size of one.
An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.
The Amazon Resource Name (ARN) of one listener. The listener identifies the route between a target group and a load balancer. This is an array of strings with a maximum size of one.
Information about groups of tags applied to Amazon EC2 instances. The deployment group includes only Amazon EC2 instances identified by all the tag groups. Cannot be used in the same call as ec2TagFilters
.
A list that contains other lists of Amazon EC2 instance tag groups. For an instance to be included in the deployment group, it must be identified by all of the tag groups in the list.
Information about an EC2 tag filter.
The tag filter key.
The tag filter value.
The tag filter type:
KEY_ONLY
: Key only.VALUE_ONLY
: Value only.KEY_AND_VALUE
: Key and value.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 <clustername>:<servicename>
.
Contains the service and cluster names used to identify an Amazon ECS deployment's target.
The name of the target Amazon ECS service.
The name of the cluster that the Amazon ECS service is associated with.
Information about groups of tags applied to on-premises instances. The deployment group includes only on-premises instances identified by all of the tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters
.
A list that contains other lists of on-premises instance tag groups. For an instance to be included in the deployment group, it must be identified by all of the tag groups in the list.
Information about an on-premises instance tag filter.
The on-premises instance tag filter key.
The on-premises instance tag filter value.
The on-premises instance tag filter type:
The metadata that you apply to CodeDeploy deployment groups to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.
Information about a tag.
The tag's key.
The tag's value.
dict
Response Syntax
{
'deploymentGroupId': 'string'
}
Response Structure
(dict) --
Represents the output of a CreateDeploymentGroup
operation.
deploymentGroupId (string) --
A unique deployment group ID.
Exceptions
CodeDeploy.Client.exceptions.ApplicationNameRequiredException
CodeDeploy.Client.exceptions.InvalidApplicationNameException
CodeDeploy.Client.exceptions.ApplicationDoesNotExistException
CodeDeploy.Client.exceptions.DeploymentGroupNameRequiredException
CodeDeploy.Client.exceptions.InvalidDeploymentGroupNameException
CodeDeploy.Client.exceptions.DeploymentGroupAlreadyExistsException
CodeDeploy.Client.exceptions.InvalidEC2TagException
CodeDeploy.Client.exceptions.InvalidTagException
CodeDeploy.Client.exceptions.InvalidAutoScalingGroupException
CodeDeploy.Client.exceptions.InvalidDeploymentConfigNameException
CodeDeploy.Client.exceptions.DeploymentConfigDoesNotExistException
CodeDeploy.Client.exceptions.RoleRequiredException
CodeDeploy.Client.exceptions.InvalidRoleException
CodeDeploy.Client.exceptions.DeploymentGroupLimitExceededException
CodeDeploy.Client.exceptions.LifecycleHookLimitExceededException
CodeDeploy.Client.exceptions.InvalidTriggerConfigException
CodeDeploy.Client.exceptions.TriggerTargetsLimitExceededException
CodeDeploy.Client.exceptions.InvalidAlarmConfigException
CodeDeploy.Client.exceptions.AlarmsLimitExceededException
CodeDeploy.Client.exceptions.InvalidAutoRollbackConfigException
CodeDeploy.Client.exceptions.InvalidLoadBalancerInfoException
CodeDeploy.Client.exceptions.InvalidDeploymentStyleException
CodeDeploy.Client.exceptions.InvalidBlueGreenDeploymentConfigurationException
CodeDeploy.Client.exceptions.InvalidEC2TagCombinationException
CodeDeploy.Client.exceptions.InvalidOnPremisesTagCombinationException
CodeDeploy.Client.exceptions.TagSetListLimitExceededException
CodeDeploy.Client.exceptions.InvalidInputException
CodeDeploy.Client.exceptions.ThrottlingException
CodeDeploy.Client.exceptions.InvalidECSServiceException
CodeDeploy.Client.exceptions.InvalidTargetGroupPairException
CodeDeploy.Client.exceptions.ECSServiceMappingLimitExceededException
CodeDeploy.Client.exceptions.InvalidTagsToAddException
CodeDeploy.Client.exceptions.InvalidTrafficRoutingConfigurationException