Menu
AWS CodeDeploy
API Reference (API Version 2014-10-06)

CreateDeploymentGroup

Creates a deployment group to which application revisions will be deployed.

Request Syntax

Copy
{ "alarmConfiguration": { "alarms": [ { "name": "string" } ], "enabled": boolean, "ignorePollAlarmFailure": boolean }, "applicationName": "string", "autoRollbackConfiguration": { "enabled": boolean, "events": [ "string" ] }, "autoScalingGroups": [ "string" ], "blueGreenDeploymentConfiguration": { "deploymentReadyOption": { "actionOnTimeout": "string", "waitTimeInMinutes": number }, "greenFleetProvisioningOption": { "action": "string" }, "terminateBlueInstancesOnDeploymentSuccess": { "action": "string", "terminationWaitTimeInMinutes": number } }, "deploymentConfigName": "string", "deploymentGroupName": "string", "deploymentStyle": { "deploymentOption": "string", "deploymentType": "string" }, "ec2TagFilters": [ { "Key": "string", "Type": "string", "Value": "string" } ], "loadBalancerInfo": { "elbInfoList": [ { "name": "string" } ] }, "onPremisesInstanceTagFilters": [ { "Key": "string", "Type": "string", "Value": "string" } ], "serviceRoleArn": "string", "triggerConfigurations": [ { "triggerEvents": [ "string" ], "triggerName": "string", "triggerTargetArn": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

alarmConfiguration

Information to add about Amazon CloudWatch alarms when the deployment group is created.

Type: AlarmConfiguration object

Required: No

applicationName

The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

autoRollbackConfiguration

Configuration information for an automatic rollback that is added when a deployment group is created.

Type: AutoRollbackConfiguration object

Required: No

autoScalingGroups

A list of associated Auto Scaling groups.

Type: array of Strings

Required: No

blueGreenDeploymentConfiguration

Information about blue/green deployment options for a deployment group.

Type: BlueGreenDeploymentConfiguration object

Required: No

deploymentConfigName

If specified, the deployment configuration name can be either one of the predefined configurations provided with AWS 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 the deployment group.

For more information about the predefined deployment configurations in AWS CodeDeploy, see Working with Deployment Groups in AWS CodeDeploy in the AWS CodeDeploy User Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: No

deploymentGroupName

The name of a new deployment group for the specified application.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

deploymentStyle

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.

Type: DeploymentStyle object

Required: No

ec2TagFilters

The Amazon EC2 tags on which to filter.

Type: array of EC2TagFilter objects

Required: No

loadBalancerInfo

Information about the load balancer used in a deployment.

Type: LoadBalancerInfo object

Required: No

onPremisesInstanceTagFilters

The on-premises instance tags on which to filter.

Type: array of TagFilter objects

Required: No

serviceRoleArn

A service role ARN that allows AWS CodeDeploy to act on the user's behalf when interacting with AWS services.

Type: String

Required: Yes

triggerConfigurations

Information about triggers to create when the deployment group is created. For examples, see Create a Trigger for an AWS CodeDeploy Event in the AWS CodeDeploy User Guide.

Type: array of TriggerConfig objects

Required: No

Response Syntax

Copy
{ "deploymentGroupId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

deploymentGroupId

A unique deployment group ID.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AlarmsLimitExceededException

The maximum number of alarms for a deployment group (10) was exceeded.

HTTP Status Code: 400

ApplicationDoesNotExistException

The application does not exist with the applicable IAM user or AWS account.

HTTP Status Code: 400

ApplicationNameRequiredException

The minimum number of required application names was not specified.

HTTP Status Code: 400

DeploymentConfigDoesNotExistException

The deployment configuration does not exist with the applicable IAM user or AWS account.

HTTP Status Code: 400

DeploymentGroupAlreadyExistsException

A deployment group with the specified name already exists with the applicable IAM user or AWS account.

HTTP Status Code: 400

DeploymentGroupLimitExceededException

The deployment groups limit was exceeded.

HTTP Status Code: 400

DeploymentGroupNameRequiredException

The deployment group name was not specified.

HTTP Status Code: 400

InvalidAlarmConfigException

The format of the alarm configuration is invalid. Possible causes include:

  • The alarm list is null.

  • The alarm object is null.

  • The alarm name is empty or null or exceeds the 255 character limit.

  • Two alarms with the same name have been specified.

  • The alarm configuration is enabled but the alarm list is empty.

HTTP Status Code: 400

InvalidApplicationNameException

The application name was specified in an invalid format.

HTTP Status Code: 400

InvalidAutoRollbackConfigException

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.

HTTP Status Code: 400

InvalidAutoScalingGroupException

The Auto Scaling group was specified in an invalid format or does not exist.

HTTP Status Code: 400

InvalidBlueGreenDeploymentConfigurationException

The configuration for the blue/green deployment group was provided in an invalid format. For information about deployment configuration format, see CreateDeploymentConfig.

HTTP Status Code: 400

InvalidDeploymentConfigNameException

The deployment configuration name was specified in an invalid format.

HTTP Status Code: 400

InvalidDeploymentGroupNameException

The deployment group name was specified in an invalid format.

HTTP Status Code: 400

InvalidDeploymentStyleException

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".

HTTP Status Code: 400

InvalidEC2TagException

The tag was specified in an invalid format.

HTTP Status Code: 400

InvalidLoadBalancerInfoException

An invalid load balancer name, or no load balancer name, was specified.

HTTP Status Code: 400

InvalidRoleException

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 Auto Scaling.

HTTP Status Code: 400

InvalidTagException

The specified tag was specified in an invalid format.

HTTP Status Code: 400

InvalidTriggerConfigException

The trigger was specified in an invalid format.

HTTP Status Code: 400

LifecycleHookLimitExceededException

The limit for lifecycle hooks was exceeded.

HTTP Status Code: 400

RoleRequiredException

The role ID was not specified.

HTTP Status Code: 400

TriggerTargetsLimitExceededException

The maximum allowed number of triggers was exceeded.

HTTP Status Code: 400

Example

Sample Request

Copy
POST / HTTP/1.1 Host: codedeploy.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 294 X-Amz-Target: CodeDeploy_20141006.CreateDeploymentGroup X-Amz-Date: 20160707T000818Z User-Agent: aws-cli/1.10.6 Python/2.7.9 Windows/7 botocore/1.3.28 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20160707/us-east-1/codedeploy/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE { "alarmConfiguration": { "alarms": [ { "name": "project-abc-alarm" } ], "enabled": true, "ignorePollAlarmFailure": false }, "applicationName": "TestApp-us-east-1", "autoRollbackConfiguration": { "enabled": true, "events": [ "DEPLOYMENT_FAILURE" ] }, "serviceRoleArn": "arn:aws:iam::444455556666:role/AnyCompany-service-role", "ec2TagFilters": [ { "Type": "KEY_AND_VALUE", "Key": "Name", "Value": "Project-ABC" } ], "deploymentGroupName": "dep-group-ghi-789-2", "deploymentConfigName": "CodeDeployDefault.OneAtATime", "deploymentStyle": { "deploymentOption": "WITH_TRAFFIC_CONTROL", "deploymentType": "IN_PLACE" }, "loadBalancerInfo": { "elbInfoList": [ { "name": "USEastLoadBalancer" } ] }, "triggerConfigurations": [ { "triggerEvents": [ "DeploymentFailure" ], "triggerName": "Trigger-group-us-east-1-deploy-fail", "triggerTargetArn": "arn:aws:sns:us-east-1:80398EXAMPLE:us-east-deploy-fail" } ] }

Sample Response

Copy
HTTP/1.1 200 OK x-amzn-RequestId: 7aed4309-88d1-11e5-b0f5-a331fa97e4b5 Content-Type: application/x-amz-json-1.1 Content-Length: 60 { "deploymentGroupId": "e9be2617-8b71-46a1-944a-3c45c9138ee7" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: