get_deployment
(**kwargs)¶Gets information about a deployment.
Note
The content
property of the appSpecContent
object in the returned revision is always null. Use GetApplicationRevision
and the sha256
property of the returned appSpecContent
object to get the content of the deployment’s AppSpec file.
See also: AWS API Documentation
Request Syntax
response = client.get_deployment(
deploymentId='string'
)
[REQUIRED]
The unique ID of a deployment associated with the IAM user or Amazon Web Services account.
{
'deploymentInfo': {
'applicationName': 'string',
'deploymentGroupName': 'string',
'deploymentConfigName': 'string',
'deploymentId': 'string',
'previousRevision': {
'revisionType': 'S3'|'GitHub'|'String'|'AppSpecContent',
's3Location': {
'bucket': 'string',
'key': 'string',
'bundleType': 'tar'|'tgz'|'zip'|'YAML'|'JSON',
'version': 'string',
'eTag': 'string'
},
'gitHubLocation': {
'repository': 'string',
'commitId': 'string'
},
'string': {
'content': 'string',
'sha256': 'string'
},
'appSpecContent': {
'content': 'string',
'sha256': 'string'
}
},
'revision': {
'revisionType': 'S3'|'GitHub'|'String'|'AppSpecContent',
's3Location': {
'bucket': 'string',
'key': 'string',
'bundleType': 'tar'|'tgz'|'zip'|'YAML'|'JSON',
'version': 'string',
'eTag': 'string'
},
'gitHubLocation': {
'repository': 'string',
'commitId': 'string'
},
'string': {
'content': 'string',
'sha256': 'string'
},
'appSpecContent': {
'content': 'string',
'sha256': 'string'
}
},
'status': 'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
'errorInformation': {
'code': 'AGENT_ISSUE'|'ALARM_ACTIVE'|'APPLICATION_MISSING'|'AUTOSCALING_VALIDATION_ERROR'|'AUTO_SCALING_CONFIGURATION'|'AUTO_SCALING_IAM_ROLE_PERMISSIONS'|'CODEDEPLOY_RESOURCE_CANNOT_BE_FOUND'|'CUSTOMER_APPLICATION_UNHEALTHY'|'DEPLOYMENT_GROUP_MISSING'|'ECS_UPDATE_ERROR'|'ELASTIC_LOAD_BALANCING_INVALID'|'ELB_INVALID_INSTANCE'|'HEALTH_CONSTRAINTS'|'HEALTH_CONSTRAINTS_INVALID'|'HOOK_EXECUTION_FAILURE'|'IAM_ROLE_MISSING'|'IAM_ROLE_PERMISSIONS'|'INTERNAL_ERROR'|'INVALID_ECS_SERVICE'|'INVALID_LAMBDA_CONFIGURATION'|'INVALID_LAMBDA_FUNCTION'|'INVALID_REVISION'|'MANUAL_STOP'|'MISSING_BLUE_GREEN_DEPLOYMENT_CONFIGURATION'|'MISSING_ELB_INFORMATION'|'MISSING_GITHUB_TOKEN'|'NO_EC2_SUBSCRIPTION'|'NO_INSTANCES'|'OVER_MAX_INSTANCES'|'RESOURCE_LIMIT_EXCEEDED'|'REVISION_MISSING'|'THROTTLED'|'TIMEOUT'|'CLOUDFORMATION_STACK_FAILURE',
'message': 'string'
},
'createTime': datetime(2015, 1, 1),
'startTime': datetime(2015, 1, 1),
'completeTime': datetime(2015, 1, 1),
'deploymentOverview': {
'Pending': 123,
'InProgress': 123,
'Succeeded': 123,
'Failed': 123,
'Skipped': 123,
'Ready': 123
},
'description': 'string',
'creator': 'user'|'autoscaling'|'codeDeployRollback'|'CodeDeploy'|'CodeDeployAutoUpdate'|'CloudFormation'|'CloudFormationRollback',
'ignoreApplicationStopFailures': True|False,
'autoRollbackConfiguration': {
'enabled': True|False,
'events': [
'DEPLOYMENT_FAILURE'|'DEPLOYMENT_STOP_ON_ALARM'|'DEPLOYMENT_STOP_ON_REQUEST',
]
},
'updateOutdatedInstancesOnly': True|False,
'rollbackInfo': {
'rollbackDeploymentId': 'string',
'rollbackTriggeringDeploymentId': 'string',
'rollbackMessage': 'string'
},
'deploymentStyle': {
'deploymentType': 'IN_PLACE'|'BLUE_GREEN',
'deploymentOption': 'WITH_TRAFFIC_CONTROL'|'WITHOUT_TRAFFIC_CONTROL'
},
'targetInstances': {
'tagFilters': [
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
'autoScalingGroups': [
'string',
],
'ec2TagSet': {
'ec2TagSetList': [
[
{
'Key': 'string',
'Value': 'string',
'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
},
],
]
}
},
'instanceTerminationWaitTimeStarted': True|False,
'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',
]
}
},
]
},
'additionalDeploymentStatusInfo': 'string',
'fileExistsBehavior': 'DISALLOW'|'OVERWRITE'|'RETAIN',
'deploymentStatusMessages': [
'string',
],
'computePlatform': 'Server'|'Lambda'|'ECS',
'externalId': 'string',
'relatedDeployments': {
'autoUpdateOutdatedInstancesRootDeploymentId': 'string',
'autoUpdateOutdatedInstancesDeploymentIds': [
'string',
]
},
'overrideAlarmConfiguration': {
'enabled': True|False,
'ignorePollAlarmFailure': True|False,
'alarms': [
{
'name': 'string'
},
]
}
}
}
Response Structure
Represents the output of a GetDeployment
operation.
Information about the deployment.
The application name.
The deployment group name.
The deployment configuration name.
The unique ID of a deployment.
Information about the application revision that was deployed to the deployment group before the most recent successful deployment.
The type of application revision:
AppSpecContent
object that contains the contents of an AppSpec file for an Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.Information about the location of a revision stored in Amazon S3.
The name of the Amazon S3 bucket where the application revision is stored.
The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
The file type of the application revision. Must be one of the following:
tar
: A tar archive file.tgz
: A compressed tar archive file.zip
: A zip archive file.A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
If the version is not specified, the system uses the most recent version by default.
The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
Information about the location of application artifacts stored in GitHub.
The GitHub account and repository pair that stores a reference to the commit that represents the bundled artifacts for the application revision.
Specified as account/repository.
The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.
Information about the location of an Lambda deployment revision stored as a RawString.
The YAML-formatted or JSON-formatted revision string. It includes information about which Lambda function to update and optional Lambda functions that validate deployment lifecycle events.
The SHA256 hash value of the revision content.
The content of an AppSpec file for an Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.
The YAML-formatted or JSON-formatted revision string.
For an Lambda deployment, the content includes a Lambda function name, the alias for its original version, and the alias for its replacement version. The deployment shifts traffic from the original version of the Lambda function to the replacement version.
For an Amazon ECS deployment, the content includes the task name, information about the load balancer that serves traffic to the container, and more.
For both types of deployments, the content can specify Lambda functions that run at specified hooks, such as BeforeInstall
, during a deployment.
The SHA256 hash value of the revision content.
Information about the location of stored application artifacts and the service from which to retrieve them.
The type of application revision:
AppSpecContent
object that contains the contents of an AppSpec file for an Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.Information about the location of a revision stored in Amazon S3.
The name of the Amazon S3 bucket where the application revision is stored.
The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
The file type of the application revision. Must be one of the following:
tar
: A tar archive file.tgz
: A compressed tar archive file.zip
: A zip archive file.A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
If the version is not specified, the system uses the most recent version by default.
The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
Information about the location of application artifacts stored in GitHub.
The GitHub account and repository pair that stores a reference to the commit that represents the bundled artifacts for the application revision.
Specified as account/repository.
The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.
Information about the location of an Lambda deployment revision stored as a RawString.
The YAML-formatted or JSON-formatted revision string. It includes information about which Lambda function to update and optional Lambda functions that validate deployment lifecycle events.
The SHA256 hash value of the revision content.
The content of an AppSpec file for an Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.
The YAML-formatted or JSON-formatted revision string.
For an Lambda deployment, the content includes a Lambda function name, the alias for its original version, and the alias for its replacement version. The deployment shifts traffic from the original version of the Lambda function to the replacement version.
For an Amazon ECS deployment, the content includes the task name, information about the load balancer that serves traffic to the container, and more.
For both types of deployments, the content can specify Lambda functions that run at specified hooks, such as BeforeInstall
, during a deployment.
The SHA256 hash value of the revision content.
The current state of the deployment as a whole.
Information about any error associated with this deployment.
For more information, see Error Codes for CodeDeploy in the CodeDeploy User Guide.
The error code:
An accompanying error message.
A timestamp that indicates when the deployment was created.
A timestamp that indicates when the deployment was deployed to the deployment group.
In some cases, the reported value of the start time might be later than the complete time. This is due to differences in the clock settings of backend servers that participate in the deployment process.
A timestamp that indicates when the deployment was complete.
A summary of the deployment status of the instances in the deployment.
The number of instances in the deployment in a pending state.
The number of instances in which the deployment is in progress.
The number of instances in the deployment to which revisions have been successfully deployed.
The number of instances in the deployment in a failed state.
The number of instances in the deployment in a skipped state.
The number of instances in a replacement environment ready to receive traffic in a blue/green deployment.
A comment about the deployment.
The means by which the deployment was created:
user
: A user created the deployment.autoscaling
: Amazon EC2 Auto Scaling created the deployment.codeDeployRollback
: A rollback process created the deployment.CodeDeployAutoUpdate
: An auto-update process created the deployment when it detected outdated Amazon EC2 instances.If true, then if an ApplicationStop
, BeforeBlockTraffic
, or AfterBlockTraffic
deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if ApplicationStop
fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic
fails, the deployment continues with BlockTraffic
. If AfterBlockTraffic
fails, the deployment continues with ApplicationStop
.
If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.
During a deployment, the CodeDeploy agent runs the scripts specified for ApplicationStop
, BeforeBlockTraffic
, and AfterBlockTraffic
in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.
If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use ignoreApplicationStopFailures
to specify that the ApplicationStop
, BeforeBlockTraffic
, and AfterBlockTraffic
failures should be ignored.
Information about the automatic rollback configuration associated with the deployment.
Indicates whether a defined automatic rollback configuration is currently enabled.
The event type or types that trigger a rollback.
Indicates whether only instances that are not running the latest application revision are to be deployed to.
Information about a deployment rollback.
The ID of the deployment rollback.
The deployment ID of the deployment that was underway and triggered a rollback deployment because it failed or was stopped.
Information that describes the status of a deployment rollback (for example, whether the deployment can't be rolled back, is in progress, failed, or succeeded).
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.
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 the instances that belong to the replacement environment in a blue/green deployment.
The tag filter key, type, and value used to identify Amazon EC2 instances in a replacement environment for a blue/green deployment. 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 names of one or more Auto Scaling groups to identify a replacement environment for a blue/green deployment.
Information about the groups of Amazon EC2 instance tags that an instance must be identified by in order for it to be included in the replacement environment for a blue/green deployment. Cannot be used in the same call as tagFilters
.
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.Indicates whether the wait period set for the termination of instances in the original environment has started. Status is 'false' if the KEEP_ALIVE option is specified. Otherwise, 'true' as soon as the termination wait period starts.
Information about blue/green deployment options for this deployment.
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 the 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.
Provides information about the results of a deployment, such as whether instances in the original environment in a blue/green deployment were not terminated.
Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.
DISALLOW
: The deployment fails. This is also the default behavior if no option is specified.OVERWRITE
: The version of the file from the application revision currently being deployed replaces the version already on the instance.RETAIN
: The version of the file already on the instance is kept and used as part of the new deployment.Messages that contain information about the status of a deployment.
The destination platform type for the deployment ( Lambda
, Server
, or ECS
).
The unique ID for an external resource (for example, a CloudFormation stack ID) that is linked to this deployment.
Information about deployments related to the specified deployment.
The deployment ID of the root deployment that triggered this deployment.
The deployment IDs of 'auto-update outdated instances' deployments triggered by this deployment.
Information about alarms associated with a deployment or deployment group.
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.
Exceptions
CodeDeploy.Client.exceptions.DeploymentIdRequiredException
CodeDeploy.Client.exceptions.InvalidDeploymentIdException
CodeDeploy.Client.exceptions.DeploymentDoesNotExistException