AWS CodeDeploy

2020/05/20 - AWS CodeDeploy - 1 new 7 updated api methods

Changes  Amazon ECS customers using application and network load balancers can use CodeDeploy BlueGreen hook to invoke a CloudFormation stack update. With this update you can view CloudFormation deployment and target details via existing APIs and use your stack Id to list or delete all deployments associated with the stack.

DeleteResourcesByExternalId (new) Link ¶

Deletes resources linked to an external ID.

See also: AWS API Documentation

Request Syntax

client.delete_resources_by_external_id(
    externalId='string'
)
type externalId

string

param externalId

The unique ID of an external resource (for example, a CloudFormation stack ID) that is linked to one or more CodeDeploy resources.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

BatchGetDeploymentGroups (updated) Link ¶
Changes (response)
{'deploymentGroupsInfo': {'lastAttemptedDeployment': {'status': {'Baking'}},
                          'lastSuccessfulDeployment': {'status': {'Baking'}}}}

Gets information about one or more deployment groups.

See also: AWS API Documentation

Request Syntax

client.batch_get_deployment_groups(
    applicationName='string',
    deploymentGroupNames=[
        'string',
    ]
)
type applicationName

string

param applicationName

[REQUIRED]

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

type deploymentGroupNames

list

param deploymentGroupNames

[REQUIRED]

The names of the deployment groups.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'deploymentGroupsInfo': [
        {
            'applicationName': 'string',
            'deploymentGroupId': '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': [
                {
                    'name': 'string',
                    'hook': 'string'
                },
            ],
            'serviceRoleArn': 'string',
            'targetRevision': {
                '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'
                }
            },
            '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',
                ]
            },
            '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',
                            ]
                        }
                    },
                ]
            },
            'lastSuccessfulDeployment': {
                'deploymentId': 'string',
                'status': 'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
                'endTime': datetime(2015, 1, 1),
                'createTime': datetime(2015, 1, 1)
            },
            'lastAttemptedDeployment': {
                'deploymentId': 'string',
                'status': 'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
                'endTime': datetime(2015, 1, 1),
                'createTime': datetime(2015, 1, 1)
            },
            'ec2TagSet': {
                'ec2TagSetList': [
                    [
                        {
                            'Key': 'string',
                            'Value': 'string',
                            'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
                        },
                    ],
                ]
            },
            'onPremisesTagSet': {
                'onPremisesTagSetList': [
                    [
                        {
                            'Key': 'string',
                            'Value': 'string',
                            'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
                        },
                    ],
                ]
            },
            'computePlatform': 'Server'|'Lambda'|'ECS',
            'ecsServices': [
                {
                    'serviceName': 'string',
                    'clusterName': 'string'
                },
            ]
        },
    ],
    'errorMessage': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a BatchGetDeploymentGroups operation.

    • deploymentGroupsInfo (list) --

      Information about the deployment groups.

      • (dict) --

        Information about a deployment group.

        • applicationName (string) --

          The application name.

        • deploymentGroupId (string) --

          The deployment group ID.

        • deploymentGroupName (string) --

          The deployment group name.

        • deploymentConfigName (string) --

          The deployment configuration name.

        • ec2TagFilters (list) --

          The Amazon EC2 tags on which to filter. The deployment group includes EC2 instances with any of the specified tags.

          • (dict) --

            Information about an EC2 tag filter.

            • Key (string) --

              The tag filter key.

            • Value (string) --

              The tag filter value.

            • Type (string) --

              The tag filter type:

              • KEY_ONLY : Key only.

              • VALUE_ONLY : Value only.

              • KEY_AND_VALUE : Key and value.

        • onPremisesInstanceTagFilters (list) --

          The on-premises instance tags on which to filter. The deployment group includes on-premises instances with any of the specified tags.

          • (dict) --

            Information about an on-premises instance tag filter.

            • Key (string) --

              The on-premises instance tag filter key.

            • Value (string) --

              The on-premises instance tag filter value.

            • Type (string) --

              The on-premises instance tag filter type:

              • KEY_ONLY: Key only.

              • VALUE_ONLY: Value only.

              • KEY_AND_VALUE: Key and value.

        • autoScalingGroups (list) --

          A list of associated Auto Scaling groups.

          • (dict) --

            Information about an Auto Scaling group.

            • name (string) --

              The Auto Scaling group name.

            • hook (string) --

              An Auto Scaling lifecycle event hook name.

        • serviceRoleArn (string) --

          A service role Amazon Resource Name (ARN) that grants CodeDeploy permission to make calls to AWS services on your behalf. For more information, see Create a Service Role for AWS CodeDeploy in the AWS CodeDeploy User Guide .

        • targetRevision (dict) --

          Information about the deployment group's target revision, including type and location.

          • revisionType (string) --

            The type of application revision:

            • S3: An application revision stored in Amazon S3.

            • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

            • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

            • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

          • s3Location (dict) --

            Information about the location of a revision stored in Amazon S3.

            • bucket (string) --

              The name of the Amazon S3 bucket where the application revision is stored.

            • key (string) --

              The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

            • bundleType (string) --

              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.

            • version (string) --

              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.

            • eTag (string) --

              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.

          • gitHubLocation (dict) --

            Information about the location of application artifacts stored in GitHub.

            • repository (string) --

              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.

            • commitId (string) --

              The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

          • string (dict) --

            Information about the location of an AWS Lambda deployment revision stored as a RawString.

            • content (string) --

              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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

          • appSpecContent (dict) --

            The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

            • content (string) --

              The YAML-formatted or JSON-formatted revision string.

              For an AWS 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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

        • triggerConfigurations (list) --

          Information about triggers associated with the deployment group.

          • (dict) --

            Information about notification triggers for the deployment group.

            • triggerName (string) --

              The name of the notification trigger.

            • triggerTargetArn (string) --

              The Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic through which notifications about deployment or instance events are sent.

            • triggerEvents (list) --

              The event type or types for which notifications are triggered.

              • (string) --

        • alarmConfiguration (dict) --

          A list of alarms associated with the deployment group.

          • enabled (boolean) --

            Indicates whether the alarm configuration is enabled.

          • ignorePollAlarmFailure (boolean) --

            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.

          • alarms (list) --

            A list of alarms configured for the deployment group. A maximum of 10 alarms can be added to a deployment group.

            • (dict) --

              Information about an alarm.

              • name (string) --

                The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.

        • autoRollbackConfiguration (dict) --

          Information about the automatic rollback configuration associated with the deployment group.

          • enabled (boolean) --

            Indicates whether a defined automatic rollback configuration is currently enabled.

          • events (list) --

            The event type or types that trigger a rollback.

            • (string) --

        • deploymentStyle (dict) --

          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.

          • deploymentType (string) --

            Indicates whether to run an in-place deployment or a blue/green deployment.

          • deploymentOption (string) --

            Indicates whether to route deployment traffic behind a load balancer.

        • blueGreenDeploymentConfiguration (dict) --

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

          • terminateBlueInstancesOnDeploymentSuccess (dict) --

            Information about whether to terminate instances in the original fleet during a blue/green deployment.

            • action (string) --

              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.

            • terminationWaitTimeInMinutes (integer) --

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

          • deploymentReadyOption (dict) --

            Information about the action to take when newly provisioned instances are ready to receive traffic in a blue/green deployment.

            • actionOnTimeout (string) --

              Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.

              • CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately after the new application revision is installed on the instances in the replacement environment.

              • STOP_DEPLOYMENT: Do not register new instances with a load balancer unless traffic rerouting is started using ContinueDeployment . If traffic rerouting is not started before the end of the specified wait period, the deployment status is changed to Stopped.

            • waitTimeInMinutes (integer) --

              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 .

          • greenFleetProvisioningOption (dict) --

            Information about how instances are provisioned for a replacement environment in a blue/green deployment.

            • action (string) --

              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.

        • loadBalancerInfo (dict) --

          Information about the load balancer to use in a deployment.

          • elbInfoList (list) --

            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.

            • (dict) --

              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.

              • name (string) --

                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.

          • targetGroupInfoList (list) --

            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.

            • (dict) --

              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.

              • name (string) --

                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.

          • targetGroupPairInfoList (list) --

            The target group pair information. This is an array of TargeGroupPairInfo objects with a maximum size of one.

            • (dict) --

              Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.

              • targetGroups (list) --

                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.

                • (dict) --

                  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.

                  • name (string) --

                    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.

              • prodTrafficRoute (dict) --

                The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.

                • listenerArns (list) --

                  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.

                  • (string) --

              • testTrafficRoute (dict) --

                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.

                • listenerArns (list) --

                  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.

                  • (string) --

        • lastSuccessfulDeployment (dict) --

          Information about the most recent successful deployment to the deployment group.

          • deploymentId (string) --

            The unique ID of a deployment.

          • status (string) --

            The status of the most recent deployment.

          • endTime (datetime) --

            A timestamp that indicates when the most recent deployment to the deployment group was complete.

          • createTime (datetime) --

            A timestamp that indicates when the most recent deployment to the deployment group started.

        • lastAttemptedDeployment (dict) --

          Information about the most recent attempted deployment to the deployment group.

          • deploymentId (string) --

            The unique ID of a deployment.

          • status (string) --

            The status of the most recent deployment.

          • endTime (datetime) --

            A timestamp that indicates when the most recent deployment to the deployment group was complete.

          • createTime (datetime) --

            A timestamp that indicates when the most recent deployment to the deployment group started.

        • ec2TagSet (dict) --

          Information about groups of tags applied to an EC2 instance. The deployment group includes only EC2 instances identified by all of the tag groups. Cannot be used in the same call as ec2TagFilters.

          • ec2TagSetList (list) --

            A list that contains other lists of 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.

            • (list) --

              • (dict) --

                Information about an EC2 tag filter.

                • Key (string) --

                  The tag filter key.

                • Value (string) --

                  The tag filter value.

                • Type (string) --

                  The tag filter type:

                  • KEY_ONLY : Key only.

                  • VALUE_ONLY : Value only.

                  • KEY_AND_VALUE : Key and value.

        • onPremisesTagSet (dict) --

          Information about groups of tags applied to an on-premises instance. The deployment group includes only on-premises instances identified by all the tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters.

          • onPremisesTagSetList (list) --

            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.

            • (list) --

              • (dict) --

                Information about an on-premises instance tag filter.

                • Key (string) --

                  The on-premises instance tag filter key.

                • Value (string) --

                  The on-premises instance tag filter value.

                • Type (string) --

                  The on-premises instance tag filter type:

                  • KEY_ONLY: Key only.

                  • VALUE_ONLY: Value only.

                  • KEY_AND_VALUE: Key and value.

        • computePlatform (string) --

          The destination platform type for the deployment (Lambda , Server , or ECS ).

        • ecsServices (list) --

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

          • (dict) --

            Contains the service and cluster names used to identify an Amazon ECS deployment's target.

            • serviceName (string) --

              The name of the target Amazon ECS service.

            • clusterName (string) --

              The name of the cluster that the Amazon ECS service is associated with.

    • errorMessage (string) --

      Information about errors that might have occurred during the API call.

BatchGetDeploymentTargets (updated) Link ¶
Changes (response)
{'deploymentTargets': {'cloudFormationTarget': {'deploymentId': 'string',
                                                'lastUpdatedAt': 'timestamp',
                                                'lifecycleEvents': [{'diagnostics': {'errorCode': 'Success '
                                                                                                  '| '
                                                                                                  'ScriptMissing '
                                                                                                  '| '
                                                                                                  'ScriptNotExecutable '
                                                                                                  '| '
                                                                                                  'ScriptTimedOut '
                                                                                                  '| '
                                                                                                  'ScriptFailed '
                                                                                                  '| '
                                                                                                  'UnknownError',
                                                                                     'logTail': 'string',
                                                                                     'message': 'string',
                                                                                     'scriptName': 'string'},
                                                                     'endTime': 'timestamp',
                                                                     'lifecycleEventName': 'string',
                                                                     'startTime': 'timestamp',
                                                                     'status': 'Pending '
                                                                               '| '
                                                                               'InProgress '
                                                                               '| '
                                                                               'Succeeded '
                                                                               '| '
                                                                               'Failed '
                                                                               '| '
                                                                               'Skipped '
                                                                               '| '
                                                                               'Unknown'}],
                                                'resourceType': 'string',
                                                'status': 'Pending | '
                                                          'InProgress | '
                                                          'Succeeded | Failed '
                                                          '| Skipped | Unknown '
                                                          '| Ready',
                                                'targetId': 'string',
                                                'targetVersionWeight': 'double'},
                       'deploymentTargetType': {'CloudFormationTarget'}}}

Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances . The maximum number of targets that can be returned is 25.

The type of targets returned depends on the deployment's compute platform or deployment method:

  • EC2/On-premises : Information about EC2 instance targets.

  • AWS Lambda : Information about Lambda functions targets.

  • Amazon ECS : Information about Amazon ECS service targets.

  • CloudFormation : Information about targets of blue/green deployments initiated by a CloudFormation stack update.

See also: AWS API Documentation

Request Syntax

client.batch_get_deployment_targets(
    deploymentId='string',
    targetIds=[
        'string',
    ]
)
type deploymentId

string

param deploymentId

The unique ID of a deployment.

type targetIds

list

param targetIds

The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.

  • For deployments that use the EC2/On-premises compute platform, the target IDs are EC2 or on-premises instances IDs, and their target type is instanceTarget .

  • For deployments that use the AWS Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is instanceTarget .

  • For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format <clustername>:<servicename> . Their target type is ecsTarget .

  • For deployments that are deployed with AWS CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is cloudFormationTarget .

  • (string) --

rtype

dict

returns

Response Syntax

{
    'deploymentTargets': [
        {
            'deploymentTargetType': 'InstanceTarget'|'LambdaTarget'|'ECSTarget'|'CloudFormationTarget',
            'instanceTarget': {
                'deploymentId': 'string',
                'targetId': 'string',
                'targetArn': 'string',
                'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
                'lastUpdatedAt': datetime(2015, 1, 1),
                'lifecycleEvents': [
                    {
                        'lifecycleEventName': 'string',
                        'diagnostics': {
                            'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                            'scriptName': 'string',
                            'message': 'string',
                            'logTail': 'string'
                        },
                        'startTime': datetime(2015, 1, 1),
                        'endTime': datetime(2015, 1, 1),
                        'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                    },
                ],
                'instanceLabel': 'Blue'|'Green'
            },
            'lambdaTarget': {
                'deploymentId': 'string',
                'targetId': 'string',
                'targetArn': 'string',
                'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
                'lastUpdatedAt': datetime(2015, 1, 1),
                'lifecycleEvents': [
                    {
                        'lifecycleEventName': 'string',
                        'diagnostics': {
                            'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                            'scriptName': 'string',
                            'message': 'string',
                            'logTail': 'string'
                        },
                        'startTime': datetime(2015, 1, 1),
                        'endTime': datetime(2015, 1, 1),
                        'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                    },
                ],
                'lambdaFunctionInfo': {
                    'functionName': 'string',
                    'functionAlias': 'string',
                    'currentVersion': 'string',
                    'targetVersion': 'string',
                    'targetVersionWeight': 123.0
                }
            },
            'ecsTarget': {
                'deploymentId': 'string',
                'targetId': 'string',
                'targetArn': 'string',
                'lastUpdatedAt': datetime(2015, 1, 1),
                'lifecycleEvents': [
                    {
                        'lifecycleEventName': 'string',
                        'diagnostics': {
                            'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                            'scriptName': 'string',
                            'message': 'string',
                            'logTail': 'string'
                        },
                        'startTime': datetime(2015, 1, 1),
                        'endTime': datetime(2015, 1, 1),
                        'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                    },
                ],
                'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
                'taskSetsInfo': [
                    {
                        'identifer': 'string',
                        'desiredCount': 123,
                        'pendingCount': 123,
                        'runningCount': 123,
                        'status': 'string',
                        'trafficWeight': 123.0,
                        'targetGroup': {
                            'name': 'string'
                        },
                        'taskSetLabel': 'Blue'|'Green'
                    },
                ]
            },
            'cloudFormationTarget': {
                'deploymentId': 'string',
                'targetId': 'string',
                'lastUpdatedAt': datetime(2015, 1, 1),
                'lifecycleEvents': [
                    {
                        'lifecycleEventName': 'string',
                        'diagnostics': {
                            'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                            'scriptName': 'string',
                            'message': 'string',
                            'logTail': 'string'
                        },
                        'startTime': datetime(2015, 1, 1),
                        'endTime': datetime(2015, 1, 1),
                        'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                    },
                ],
                'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
                'resourceType': 'string',
                'targetVersionWeight': 123.0
            }
        },
    ]
}

Response Structure

  • (dict) --

    • deploymentTargets (list) --

      A list of target objects for a deployment. Each target object contains details about the target, such as its status and lifecycle events. The type of the target objects depends on the deployment' compute platform.

      • EC2/On-premises : Each target object is an EC2 or on-premises instance.

      • AWS Lambda : The target object is a specific version of an AWS Lambda function.

      • Amazon ECS : The target object is an Amazon ECS service.

      • CloudFormation : The target object is an AWS CloudFormation blue/green deployment.

      • (dict) --

        Information about the deployment target.

        • deploymentTargetType (string) --

          The deployment type that is specific to the deployment's compute platform or deployments initiated by a CloudFormation stack update.

        • instanceTarget (dict) --

          Information about the target for a deployment that uses the EC2/On-premises compute platform.

          • deploymentId (string) --

            The unique ID of a deployment.

          • targetId (string) --

            The unique ID of a deployment target that has a type of instanceTarget .

          • targetArn (string) --

            The Amazon Resource Name (ARN) of the target.

          • status (string) --

            The status an EC2/On-premises deployment's target instance.

          • lastUpdatedAt (datetime) --

            The date and time when the target instance was updated by a deployment.

          • lifecycleEvents (list) --

            The lifecycle events of the deployment to this target instance.

            • (dict) --

              Information about a deployment lifecycle event.

              • lifecycleEventName (string) --

                The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

              • diagnostics (dict) --

                Diagnostic information about the deployment lifecycle event.

                • errorCode (string) --

                  The associated error code:

                  • Success: The specified script ran.

                  • ScriptMissing: The specified script was not found in the specified location.

                  • ScriptNotExecutable: The specified script is not a recognized executable file type.

                  • ScriptTimedOut: The specified script did not finish running in the specified time period.

                  • ScriptFailed: The specified script failed to run as expected.

                  • UnknownError: The specified script did not run for an unknown reason.

                • scriptName (string) --

                  The name of the script.

                • message (string) --

                  The message associated with the error.

                • logTail (string) --

                  The last portion of the diagnostic log.

                  If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

              • startTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event started.

              • endTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event ended.

              • status (string) --

                The deployment lifecycle event status:

                • Pending: The deployment lifecycle event is pending.

                • InProgress: The deployment lifecycle event is in progress.

                • Succeeded: The deployment lifecycle event ran successfully.

                • Failed: The deployment lifecycle event has failed.

                • Skipped: The deployment lifecycle event has been skipped.

                • Unknown: The deployment lifecycle event is unknown.

          • instanceLabel (string) --

            A label that identifies whether the instance is an original target (BLUE ) or a replacement target (GREEN ).

        • lambdaTarget (dict) --

          Information about the target for a deployment that uses the AWS Lambda compute platform.

          • deploymentId (string) --

            The unique ID of a deployment.

          • targetId (string) --

            The unique ID of a deployment target that has a type of lambdaTarget .

          • targetArn (string) --

            The Amazon Resource Name (ARN) of the target.

          • status (string) --

            The status an AWS Lambda deployment's target Lambda function.

          • lastUpdatedAt (datetime) --

            The date and time when the target Lambda function was updated by a deployment.

          • lifecycleEvents (list) --

            The lifecycle events of the deployment to this target Lambda function.

            • (dict) --

              Information about a deployment lifecycle event.

              • lifecycleEventName (string) --

                The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

              • diagnostics (dict) --

                Diagnostic information about the deployment lifecycle event.

                • errorCode (string) --

                  The associated error code:

                  • Success: The specified script ran.

                  • ScriptMissing: The specified script was not found in the specified location.

                  • ScriptNotExecutable: The specified script is not a recognized executable file type.

                  • ScriptTimedOut: The specified script did not finish running in the specified time period.

                  • ScriptFailed: The specified script failed to run as expected.

                  • UnknownError: The specified script did not run for an unknown reason.

                • scriptName (string) --

                  The name of the script.

                • message (string) --

                  The message associated with the error.

                • logTail (string) --

                  The last portion of the diagnostic log.

                  If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

              • startTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event started.

              • endTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event ended.

              • status (string) --

                The deployment lifecycle event status:

                • Pending: The deployment lifecycle event is pending.

                • InProgress: The deployment lifecycle event is in progress.

                • Succeeded: The deployment lifecycle event ran successfully.

                • Failed: The deployment lifecycle event has failed.

                • Skipped: The deployment lifecycle event has been skipped.

                • Unknown: The deployment lifecycle event is unknown.

          • lambdaFunctionInfo (dict) --

            A LambdaFunctionInfo object that describes a target Lambda function.

            • functionName (string) --

              The name of a Lambda function.

            • functionAlias (string) --

              The alias of a Lambda function. For more information, see AWS Lambda Function Aliases in the AWS Lambda Developer Guide .

            • currentVersion (string) --

              The version of a Lambda function that production traffic points to.

            • targetVersion (string) --

              The version of a Lambda function that production traffic points to after the Lambda function is deployed.

            • targetVersionWeight (float) --

              The percentage of production traffic that the target version of a Lambda function receives.

        • ecsTarget (dict) --

          Information about the target for a deployment that uses the Amazon ECS compute platform.

          • deploymentId (string) --

            The unique ID of a deployment.

          • targetId (string) --

            The unique ID of a deployment target that has a type of ecsTarget .

          • targetArn (string) --

            The Amazon Resource Name (ARN) of the target.

          • lastUpdatedAt (datetime) --

            The date and time when the target Amazon ECS application was updated by a deployment.

          • lifecycleEvents (list) --

            The lifecycle events of the deployment to this target Amazon ECS application.

            • (dict) --

              Information about a deployment lifecycle event.

              • lifecycleEventName (string) --

                The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

              • diagnostics (dict) --

                Diagnostic information about the deployment lifecycle event.

                • errorCode (string) --

                  The associated error code:

                  • Success: The specified script ran.

                  • ScriptMissing: The specified script was not found in the specified location.

                  • ScriptNotExecutable: The specified script is not a recognized executable file type.

                  • ScriptTimedOut: The specified script did not finish running in the specified time period.

                  • ScriptFailed: The specified script failed to run as expected.

                  • UnknownError: The specified script did not run for an unknown reason.

                • scriptName (string) --

                  The name of the script.

                • message (string) --

                  The message associated with the error.

                • logTail (string) --

                  The last portion of the diagnostic log.

                  If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

              • startTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event started.

              • endTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event ended.

              • status (string) --

                The deployment lifecycle event status:

                • Pending: The deployment lifecycle event is pending.

                • InProgress: The deployment lifecycle event is in progress.

                • Succeeded: The deployment lifecycle event ran successfully.

                • Failed: The deployment lifecycle event has failed.

                • Skipped: The deployment lifecycle event has been skipped.

                • Unknown: The deployment lifecycle event is unknown.

          • status (string) --

            The status an Amazon ECS deployment's target ECS application.

          • taskSetsInfo (list) --

            The ECSTaskSet objects associated with the ECS target.

            • (dict) --

              Information about a set of Amazon ECS tasks in an AWS CodeDeploy deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic. An AWS CodeDeploy application that uses the Amazon ECS compute platform deploys a containerized application in an Amazon ECS service as a task set.

              • identifer (string) --

                A unique ID of an ECSTaskSet .

              • desiredCount (integer) --

                The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set.

              • pendingCount (integer) --

                The number of tasks in the task set that are in the PENDING status during an Amazon ECS deployment. A task in the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time, or when it is restarted after being in the STOPPED state.

              • runningCount (integer) --

                The number of tasks in the task set that are in the RUNNING status during an Amazon ECS deployment. A task in the RUNNING state is running and ready for use.

              • status (string) --

                The status of the task set. There are three valid task set statuses:

                • PRIMARY : Indicates the task set is serving production traffic.

                • ACTIVE : Indicates the task set is not serving production traffic.

                • DRAINING : Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group.

              • trafficWeight (float) --

                The percentage of traffic served by this task set.

              • targetGroup (dict) --

                The target group associated with the task set. The target group is used by AWS CodeDeploy to manage traffic to a task set.

                • name (string) --

                  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.

              • taskSetLabel (string) --

                A label that identifies whether the ECS task set is an original target (BLUE ) or a replacement target (GREEN ).

        • cloudFormationTarget (dict) --

          Information about the target to be updated by an AWS CloudFormation blue/green deployment. This target type is used for all deployments initiated by a CloudFormation stack update.

          • deploymentId (string) --

            The unique ID of an AWS CloudFormation blue/green deployment.

          • targetId (string) --

            The unique ID of a deployment target that has a type of CloudFormationTarget .

          • lastUpdatedAt (datetime) --

            The date and time when the target application was updated by an AWS CloudFormation blue/green deployment.

          • lifecycleEvents (list) --

            The lifecycle events of the AWS CloudFormation blue/green deployment to this target application.

            • (dict) --

              Information about a deployment lifecycle event.

              • lifecycleEventName (string) --

                The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

              • diagnostics (dict) --

                Diagnostic information about the deployment lifecycle event.

                • errorCode (string) --

                  The associated error code:

                  • Success: The specified script ran.

                  • ScriptMissing: The specified script was not found in the specified location.

                  • ScriptNotExecutable: The specified script is not a recognized executable file type.

                  • ScriptTimedOut: The specified script did not finish running in the specified time period.

                  • ScriptFailed: The specified script failed to run as expected.

                  • UnknownError: The specified script did not run for an unknown reason.

                • scriptName (string) --

                  The name of the script.

                • message (string) --

                  The message associated with the error.

                • logTail (string) --

                  The last portion of the diagnostic log.

                  If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

              • startTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event started.

              • endTime (datetime) --

                A timestamp that indicates when the deployment lifecycle event ended.

              • status (string) --

                The deployment lifecycle event status:

                • Pending: The deployment lifecycle event is pending.

                • InProgress: The deployment lifecycle event is in progress.

                • Succeeded: The deployment lifecycle event ran successfully.

                • Failed: The deployment lifecycle event has failed.

                • Skipped: The deployment lifecycle event has been skipped.

                • Unknown: The deployment lifecycle event is unknown.

          • status (string) --

            The status of an AWS CloudFormation blue/green deployment's target application.

          • resourceType (string) --

            The resource type for the AWS CloudFormation blue/green deployment.

          • targetVersionWeight (float) --

            The percentage of production traffic that the target version of an AWS CloudFormation blue/green deployment receives.

BatchGetDeployments (updated) Link ¶
Changes (response)
{'deploymentsInfo': {'creator': {'CloudFormation',
                                 'CloudFormationRollback',
                                 'CodeDeploy'},
                     'errorInformation': {'code': {'CLOUDFORMATION_STACK_FAILURE'}},
                     'externalId': 'string',
                     'status': {'Baking'}}}

Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.

See also: AWS API Documentation

Request Syntax

client.batch_get_deployments(
    deploymentIds=[
        'string',
    ]
)
type deploymentIds

list

param deploymentIds

[REQUIRED]

A list of deployment IDs, separated by spaces. The maximum number of deployment IDs you can specify is 25.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'deploymentsInfo': [
        {
            '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'|'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'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the output of a BatchGetDeployments operation.

    • deploymentsInfo (list) --

      Information about the deployments.

      • (dict) --

        Information about a deployment.

        • applicationName (string) --

          The application name.

        • deploymentGroupName (string) --

          The deployment group name.

        • deploymentConfigName (string) --

          The deployment configuration name.

        • deploymentId (string) --

          The unique ID of a deployment.

        • previousRevision (dict) --

          Information about the application revision that was deployed to the deployment group before the most recent successful deployment.

          • revisionType (string) --

            The type of application revision:

            • S3: An application revision stored in Amazon S3.

            • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

            • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

            • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

          • s3Location (dict) --

            Information about the location of a revision stored in Amazon S3.

            • bucket (string) --

              The name of the Amazon S3 bucket where the application revision is stored.

            • key (string) --

              The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

            • bundleType (string) --

              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.

            • version (string) --

              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.

            • eTag (string) --

              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.

          • gitHubLocation (dict) --

            Information about the location of application artifacts stored in GitHub.

            • repository (string) --

              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.

            • commitId (string) --

              The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

          • string (dict) --

            Information about the location of an AWS Lambda deployment revision stored as a RawString.

            • content (string) --

              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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

          • appSpecContent (dict) --

            The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

            • content (string) --

              The YAML-formatted or JSON-formatted revision string.

              For an AWS 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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

        • revision (dict) --

          Information about the location of stored application artifacts and the service from which to retrieve them.

          • revisionType (string) --

            The type of application revision:

            • S3: An application revision stored in Amazon S3.

            • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

            • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

            • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

          • s3Location (dict) --

            Information about the location of a revision stored in Amazon S3.

            • bucket (string) --

              The name of the Amazon S3 bucket where the application revision is stored.

            • key (string) --

              The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

            • bundleType (string) --

              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.

            • version (string) --

              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.

            • eTag (string) --

              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.

          • gitHubLocation (dict) --

            Information about the location of application artifacts stored in GitHub.

            • repository (string) --

              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.

            • commitId (string) --

              The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

          • string (dict) --

            Information about the location of an AWS Lambda deployment revision stored as a RawString.

            • content (string) --

              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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

          • appSpecContent (dict) --

            The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

            • content (string) --

              The YAML-formatted or JSON-formatted revision string.

              For an AWS 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.

            • sha256 (string) --

              The SHA256 hash value of the revision content.

        • status (string) --

          The current state of the deployment as a whole.

        • errorInformation (dict) --

          Information about any error associated with this deployment.

          • code (string) --

            For more information, see Error Codes for AWS CodeDeploy in the AWS CodeDeploy User Guide .

            The error code:

            • APPLICATION_MISSING: The application was missing. This error code is most likely raised if the application is deleted after the deployment is created, but before it is started.

            • DEPLOYMENT_GROUP_MISSING: The deployment group was missing. This error code is most likely raised if the deployment group is deleted after the deployment is created, but before it is started.

            • HEALTH_CONSTRAINTS: The deployment failed on too many instances to be successfully deployed within the instance health constraints specified.

            • HEALTH_CONSTRAINTS_INVALID: The revision cannot be successfully deployed within the instance health constraints specified.

            • IAM_ROLE_MISSING: The service role cannot be accessed.

            • IAM_ROLE_PERMISSIONS: The service role does not have the correct permissions.

            • INTERNAL_ERROR: There was an internal error.

            • NO_EC2_SUBSCRIPTION: The calling account is not subscribed to Amazon EC2.

            • NO_INSTANCES: No instances were specified, or no instances can be found.

            • OVER_MAX_INSTANCES: The maximum number of instances was exceeded.

            • THROTTLED: The operation was throttled because the calling account exceeded the throttling limits of one or more AWS services.

            • TIMEOUT: The deployment has timed out.

            • REVISION_MISSING: The revision ID was missing. This error code is most likely raised if the revision is deleted after the deployment is created, but before it is started.

          • message (string) --

            An accompanying error message.

        • createTime (datetime) --

          A timestamp that indicates when the deployment was created.

        • startTime (datetime) --

          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.

        • completeTime (datetime) --

          A timestamp that indicates when the deployment was complete.

        • deploymentOverview (dict) --

          A summary of the deployment status of the instances in the deployment.

          • Pending (integer) --

            The number of instances in the deployment in a pending state.

          • InProgress (integer) --

            The number of instances in which the deployment is in progress.

          • Succeeded (integer) --

            The number of instances in the deployment to which revisions have been successfully deployed.

          • Failed (integer) --

            The number of instances in the deployment in a failed state.

          • Skipped (integer) --

            The number of instances in the deployment in a skipped state.

          • Ready (integer) --

            The number of instances in a replacement environment ready to receive traffic in a blue/green deployment.

        • description (string) --

          A comment about the deployment.

        • creator (string) --

          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.

        • ignoreApplicationStopFailures (boolean) --

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

        • autoRollbackConfiguration (dict) --

          Information about the automatic rollback configuration associated with the deployment.

          • enabled (boolean) --

            Indicates whether a defined automatic rollback configuration is currently enabled.

          • events (list) --

            The event type or types that trigger a rollback.

            • (string) --

        • updateOutdatedInstancesOnly (boolean) --

          Indicates whether only instances that are not running the latest application revision are to be deployed to.

        • rollbackInfo (dict) --

          Information about a deployment rollback.

          • rollbackDeploymentId (string) --

            The ID of the deployment rollback.

          • rollbackTriggeringDeploymentId (string) --

            The deployment ID of the deployment that was underway and triggered a rollback deployment because it failed or was stopped.

          • rollbackMessage (string) --

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

        • deploymentStyle (dict) --

          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.

          • deploymentType (string) --

            Indicates whether to run an in-place deployment or a blue/green deployment.

          • deploymentOption (string) --

            Indicates whether to route deployment traffic behind a load balancer.

        • targetInstances (dict) --

          Information about the instances that belong to the replacement environment in a blue/green deployment.

          • tagFilters (list) --

            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 .

            • (dict) --

              Information about an EC2 tag filter.

              • Key (string) --

                The tag filter key.

              • Value (string) --

                The tag filter value.

              • Type (string) --

                The tag filter type:

                • KEY_ONLY : Key only.

                • VALUE_ONLY : Value only.

                • KEY_AND_VALUE : Key and value.

          • autoScalingGroups (list) --

            The names of one or more Auto Scaling groups to identify a replacement environment for a blue/green deployment.

            • (string) --

          • ec2TagSet (dict) --

            Information about the groups of 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 .

            • ec2TagSetList (list) --

              A list that contains other lists of 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.

              • (list) --

                • (dict) --

                  Information about an EC2 tag filter.

                  • Key (string) --

                    The tag filter key.

                  • Value (string) --

                    The tag filter value.

                  • Type (string) --

                    The tag filter type:

                    • KEY_ONLY : Key only.

                    • VALUE_ONLY : Value only.

                    • KEY_AND_VALUE : Key and value.

        • instanceTerminationWaitTimeStarted (boolean) --

          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.

        • blueGreenDeploymentConfiguration (dict) --

          Information about blue/green deployment options for this deployment.

          • terminateBlueInstancesOnDeploymentSuccess (dict) --

            Information about whether to terminate instances in the original fleet during a blue/green deployment.

            • action (string) --

              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.

            • terminationWaitTimeInMinutes (integer) --

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

          • deploymentReadyOption (dict) --

            Information about the action to take when newly provisioned instances are ready to receive traffic in a blue/green deployment.

            • actionOnTimeout (string) --

              Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.

              • CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately after the new application revision is installed on the instances in the replacement environment.

              • STOP_DEPLOYMENT: Do not register new instances with a load balancer unless traffic rerouting is started using ContinueDeployment . If traffic rerouting is not started before the end of the specified wait period, the deployment status is changed to Stopped.

            • waitTimeInMinutes (integer) --

              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 .

          • greenFleetProvisioningOption (dict) --

            Information about how instances are provisioned for a replacement environment in a blue/green deployment.

            • action (string) --

              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.

        • loadBalancerInfo (dict) --

          Information about the load balancer used in the deployment.

          • elbInfoList (list) --

            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.

            • (dict) --

              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.

              • name (string) --

                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.

          • targetGroupInfoList (list) --

            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.

            • (dict) --

              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.

              • name (string) --

                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.

          • targetGroupPairInfoList (list) --

            The target group pair information. This is an array of TargeGroupPairInfo objects with a maximum size of one.

            • (dict) --

              Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.

              • targetGroups (list) --

                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.

                • (dict) --

                  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.

                  • name (string) --

                    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.

              • prodTrafficRoute (dict) --

                The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.

                • listenerArns (list) --

                  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.

                  • (string) --

              • testTrafficRoute (dict) --

                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.

                • listenerArns (list) --

                  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.

                  • (string) --

        • additionalDeploymentStatusInfo (string) --

          Provides information about the results of a deployment, such as whether instances in the original environment in a blue/green deployment were not terminated.

        • fileExistsBehavior (string) --

          Information about how AWS 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.

        • deploymentStatusMessages (list) --

          Messages that contain information about the status of a deployment.

          • (string) --

        • computePlatform (string) --

          The destination platform type for the deployment (Lambda , Server , or ECS ).

        • externalId (string) --

          The unique ID for an external resource (for example, a CloudFormation stack ID) that is linked to this deployment.

GetDeployment (updated) Link ¶
Changes (response)
{'deploymentInfo': {'creator': {'CloudFormation',
                                'CloudFormationRollback',
                                'CodeDeploy'},
                    'errorInformation': {'code': {'CLOUDFORMATION_STACK_FAILURE'}},
                    'externalId': 'string',
                    'status': {'Baking'}}}

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

client.get_deployment(
    deploymentId='string'
)
type deploymentId

string

param deploymentId

[REQUIRED]

The unique ID of a deployment associated with the IAM user or AWS account.

rtype

dict

returns

Response Syntax

{
    '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'|'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'
    }
}

Response Structure

  • (dict) --

    Represents the output of a GetDeployment operation.

    • deploymentInfo (dict) --

      Information about the deployment.

      • applicationName (string) --

        The application name.

      • deploymentGroupName (string) --

        The deployment group name.

      • deploymentConfigName (string) --

        The deployment configuration name.

      • deploymentId (string) --

        The unique ID of a deployment.

      • previousRevision (dict) --

        Information about the application revision that was deployed to the deployment group before the most recent successful deployment.

        • revisionType (string) --

          The type of application revision:

          • S3: An application revision stored in Amazon S3.

          • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

          • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

          • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

        • s3Location (dict) --

          Information about the location of a revision stored in Amazon S3.

          • bucket (string) --

            The name of the Amazon S3 bucket where the application revision is stored.

          • key (string) --

            The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

          • bundleType (string) --

            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.

          • version (string) --

            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.

          • eTag (string) --

            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.

        • gitHubLocation (dict) --

          Information about the location of application artifacts stored in GitHub.

          • repository (string) --

            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.

          • commitId (string) --

            The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

        • string (dict) --

          Information about the location of an AWS Lambda deployment revision stored as a RawString.

          • content (string) --

            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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

        • appSpecContent (dict) --

          The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

          • content (string) --

            The YAML-formatted or JSON-formatted revision string.

            For an AWS 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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

      • revision (dict) --

        Information about the location of stored application artifacts and the service from which to retrieve them.

        • revisionType (string) --

          The type of application revision:

          • S3: An application revision stored in Amazon S3.

          • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

          • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

          • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

        • s3Location (dict) --

          Information about the location of a revision stored in Amazon S3.

          • bucket (string) --

            The name of the Amazon S3 bucket where the application revision is stored.

          • key (string) --

            The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

          • bundleType (string) --

            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.

          • version (string) --

            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.

          • eTag (string) --

            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.

        • gitHubLocation (dict) --

          Information about the location of application artifacts stored in GitHub.

          • repository (string) --

            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.

          • commitId (string) --

            The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

        • string (dict) --

          Information about the location of an AWS Lambda deployment revision stored as a RawString.

          • content (string) --

            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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

        • appSpecContent (dict) --

          The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

          • content (string) --

            The YAML-formatted or JSON-formatted revision string.

            For an AWS 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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

      • status (string) --

        The current state of the deployment as a whole.

      • errorInformation (dict) --

        Information about any error associated with this deployment.

        • code (string) --

          For more information, see Error Codes for AWS CodeDeploy in the AWS CodeDeploy User Guide .

          The error code:

          • APPLICATION_MISSING: The application was missing. This error code is most likely raised if the application is deleted after the deployment is created, but before it is started.

          • DEPLOYMENT_GROUP_MISSING: The deployment group was missing. This error code is most likely raised if the deployment group is deleted after the deployment is created, but before it is started.

          • HEALTH_CONSTRAINTS: The deployment failed on too many instances to be successfully deployed within the instance health constraints specified.

          • HEALTH_CONSTRAINTS_INVALID: The revision cannot be successfully deployed within the instance health constraints specified.

          • IAM_ROLE_MISSING: The service role cannot be accessed.

          • IAM_ROLE_PERMISSIONS: The service role does not have the correct permissions.

          • INTERNAL_ERROR: There was an internal error.

          • NO_EC2_SUBSCRIPTION: The calling account is not subscribed to Amazon EC2.

          • NO_INSTANCES: No instances were specified, or no instances can be found.

          • OVER_MAX_INSTANCES: The maximum number of instances was exceeded.

          • THROTTLED: The operation was throttled because the calling account exceeded the throttling limits of one or more AWS services.

          • TIMEOUT: The deployment has timed out.

          • REVISION_MISSING: The revision ID was missing. This error code is most likely raised if the revision is deleted after the deployment is created, but before it is started.

        • message (string) --

          An accompanying error message.

      • createTime (datetime) --

        A timestamp that indicates when the deployment was created.

      • startTime (datetime) --

        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.

      • completeTime (datetime) --

        A timestamp that indicates when the deployment was complete.

      • deploymentOverview (dict) --

        A summary of the deployment status of the instances in the deployment.

        • Pending (integer) --

          The number of instances in the deployment in a pending state.

        • InProgress (integer) --

          The number of instances in which the deployment is in progress.

        • Succeeded (integer) --

          The number of instances in the deployment to which revisions have been successfully deployed.

        • Failed (integer) --

          The number of instances in the deployment in a failed state.

        • Skipped (integer) --

          The number of instances in the deployment in a skipped state.

        • Ready (integer) --

          The number of instances in a replacement environment ready to receive traffic in a blue/green deployment.

      • description (string) --

        A comment about the deployment.

      • creator (string) --

        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.

      • ignoreApplicationStopFailures (boolean) --

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

      • autoRollbackConfiguration (dict) --

        Information about the automatic rollback configuration associated with the deployment.

        • enabled (boolean) --

          Indicates whether a defined automatic rollback configuration is currently enabled.

        • events (list) --

          The event type or types that trigger a rollback.

          • (string) --

      • updateOutdatedInstancesOnly (boolean) --

        Indicates whether only instances that are not running the latest application revision are to be deployed to.

      • rollbackInfo (dict) --

        Information about a deployment rollback.

        • rollbackDeploymentId (string) --

          The ID of the deployment rollback.

        • rollbackTriggeringDeploymentId (string) --

          The deployment ID of the deployment that was underway and triggered a rollback deployment because it failed or was stopped.

        • rollbackMessage (string) --

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

      • deploymentStyle (dict) --

        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.

        • deploymentType (string) --

          Indicates whether to run an in-place deployment or a blue/green deployment.

        • deploymentOption (string) --

          Indicates whether to route deployment traffic behind a load balancer.

      • targetInstances (dict) --

        Information about the instances that belong to the replacement environment in a blue/green deployment.

        • tagFilters (list) --

          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 .

          • (dict) --

            Information about an EC2 tag filter.

            • Key (string) --

              The tag filter key.

            • Value (string) --

              The tag filter value.

            • Type (string) --

              The tag filter type:

              • KEY_ONLY : Key only.

              • VALUE_ONLY : Value only.

              • KEY_AND_VALUE : Key and value.

        • autoScalingGroups (list) --

          The names of one or more Auto Scaling groups to identify a replacement environment for a blue/green deployment.

          • (string) --

        • ec2TagSet (dict) --

          Information about the groups of 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 .

          • ec2TagSetList (list) --

            A list that contains other lists of 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.

            • (list) --

              • (dict) --

                Information about an EC2 tag filter.

                • Key (string) --

                  The tag filter key.

                • Value (string) --

                  The tag filter value.

                • Type (string) --

                  The tag filter type:

                  • KEY_ONLY : Key only.

                  • VALUE_ONLY : Value only.

                  • KEY_AND_VALUE : Key and value.

      • instanceTerminationWaitTimeStarted (boolean) --

        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.

      • blueGreenDeploymentConfiguration (dict) --

        Information about blue/green deployment options for this deployment.

        • terminateBlueInstancesOnDeploymentSuccess (dict) --

          Information about whether to terminate instances in the original fleet during a blue/green deployment.

          • action (string) --

            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.

          • terminationWaitTimeInMinutes (integer) --

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

        • deploymentReadyOption (dict) --

          Information about the action to take when newly provisioned instances are ready to receive traffic in a blue/green deployment.

          • actionOnTimeout (string) --

            Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.

            • CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately after the new application revision is installed on the instances in the replacement environment.

            • STOP_DEPLOYMENT: Do not register new instances with a load balancer unless traffic rerouting is started using ContinueDeployment . If traffic rerouting is not started before the end of the specified wait period, the deployment status is changed to Stopped.

          • waitTimeInMinutes (integer) --

            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 .

        • greenFleetProvisioningOption (dict) --

          Information about how instances are provisioned for a replacement environment in a blue/green deployment.

          • action (string) --

            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.

      • loadBalancerInfo (dict) --

        Information about the load balancer used in the deployment.

        • elbInfoList (list) --

          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.

          • (dict) --

            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.

            • name (string) --

              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.

        • targetGroupInfoList (list) --

          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.

          • (dict) --

            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.

            • name (string) --

              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.

        • targetGroupPairInfoList (list) --

          The target group pair information. This is an array of TargeGroupPairInfo objects with a maximum size of one.

          • (dict) --

            Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.

            • targetGroups (list) --

              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.

              • (dict) --

                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.

                • name (string) --

                  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.

            • prodTrafficRoute (dict) --

              The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.

              • listenerArns (list) --

                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.

                • (string) --

            • testTrafficRoute (dict) --

              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.

              • listenerArns (list) --

                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.

                • (string) --

      • additionalDeploymentStatusInfo (string) --

        Provides information about the results of a deployment, such as whether instances in the original environment in a blue/green deployment were not terminated.

      • fileExistsBehavior (string) --

        Information about how AWS 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.

      • deploymentStatusMessages (list) --

        Messages that contain information about the status of a deployment.

        • (string) --

      • computePlatform (string) --

        The destination platform type for the deployment (Lambda , Server , or ECS ).

      • externalId (string) --

        The unique ID for an external resource (for example, a CloudFormation stack ID) that is linked to this deployment.

GetDeploymentGroup (updated) Link ¶
Changes (response)
{'deploymentGroupInfo': {'lastAttemptedDeployment': {'status': {'Baking'}},
                         'lastSuccessfulDeployment': {'status': {'Baking'}}}}

Gets information about a deployment group.

See also: AWS API Documentation

Request Syntax

client.get_deployment_group(
    applicationName='string',
    deploymentGroupName='string'
)
type applicationName

string

param applicationName

[REQUIRED]

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

type deploymentGroupName

string

param deploymentGroupName

[REQUIRED]

The name of a deployment group for the specified application.

rtype

dict

returns

Response Syntax

{
    'deploymentGroupInfo': {
        'applicationName': 'string',
        'deploymentGroupId': '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': [
            {
                'name': 'string',
                'hook': 'string'
            },
        ],
        'serviceRoleArn': 'string',
        'targetRevision': {
            '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'
            }
        },
        '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',
            ]
        },
        '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',
                        ]
                    }
                },
            ]
        },
        'lastSuccessfulDeployment': {
            'deploymentId': 'string',
            'status': 'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
            'endTime': datetime(2015, 1, 1),
            'createTime': datetime(2015, 1, 1)
        },
        'lastAttemptedDeployment': {
            'deploymentId': 'string',
            'status': 'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
            'endTime': datetime(2015, 1, 1),
            'createTime': datetime(2015, 1, 1)
        },
        'ec2TagSet': {
            'ec2TagSetList': [
                [
                    {
                        'Key': 'string',
                        'Value': 'string',
                        'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
                    },
                ],
            ]
        },
        'onPremisesTagSet': {
            'onPremisesTagSetList': [
                [
                    {
                        'Key': 'string',
                        'Value': 'string',
                        'Type': 'KEY_ONLY'|'VALUE_ONLY'|'KEY_AND_VALUE'
                    },
                ],
            ]
        },
        'computePlatform': 'Server'|'Lambda'|'ECS',
        'ecsServices': [
            {
                'serviceName': 'string',
                'clusterName': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Represents the output of a GetDeploymentGroup operation.

    • deploymentGroupInfo (dict) --

      Information about the deployment group.

      • applicationName (string) --

        The application name.

      • deploymentGroupId (string) --

        The deployment group ID.

      • deploymentGroupName (string) --

        The deployment group name.

      • deploymentConfigName (string) --

        The deployment configuration name.

      • ec2TagFilters (list) --

        The Amazon EC2 tags on which to filter. The deployment group includes EC2 instances with any of the specified tags.

        • (dict) --

          Information about an EC2 tag filter.

          • Key (string) --

            The tag filter key.

          • Value (string) --

            The tag filter value.

          • Type (string) --

            The tag filter type:

            • KEY_ONLY : Key only.

            • VALUE_ONLY : Value only.

            • KEY_AND_VALUE : Key and value.

      • onPremisesInstanceTagFilters (list) --

        The on-premises instance tags on which to filter. The deployment group includes on-premises instances with any of the specified tags.

        • (dict) --

          Information about an on-premises instance tag filter.

          • Key (string) --

            The on-premises instance tag filter key.

          • Value (string) --

            The on-premises instance tag filter value.

          • Type (string) --

            The on-premises instance tag filter type:

            • KEY_ONLY: Key only.

            • VALUE_ONLY: Value only.

            • KEY_AND_VALUE: Key and value.

      • autoScalingGroups (list) --

        A list of associated Auto Scaling groups.

        • (dict) --

          Information about an Auto Scaling group.

          • name (string) --

            The Auto Scaling group name.

          • hook (string) --

            An Auto Scaling lifecycle event hook name.

      • serviceRoleArn (string) --

        A service role Amazon Resource Name (ARN) that grants CodeDeploy permission to make calls to AWS services on your behalf. For more information, see Create a Service Role for AWS CodeDeploy in the AWS CodeDeploy User Guide .

      • targetRevision (dict) --

        Information about the deployment group's target revision, including type and location.

        • revisionType (string) --

          The type of application revision:

          • S3: An application revision stored in Amazon S3.

          • GitHub: An application revision stored in GitHub (EC2/On-premises deployments only).

          • String: A YAML-formatted or JSON-formatted string (AWS Lambda deployments only).

          • AppSpecContent: An AppSpecContent object that contains the contents of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML stored as a RawString.

        • s3Location (dict) --

          Information about the location of a revision stored in Amazon S3.

          • bucket (string) --

            The name of the Amazon S3 bucket where the application revision is stored.

          • key (string) --

            The name of the Amazon S3 object that represents the bundled artifacts for the application revision.

          • bundleType (string) --

            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.

          • version (string) --

            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.

          • eTag (string) --

            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.

        • gitHubLocation (dict) --

          Information about the location of application artifacts stored in GitHub.

          • repository (string) --

            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.

          • commitId (string) --

            The SHA1 commit ID of the GitHub commit that represents the bundled artifacts for the application revision.

        • string (dict) --

          Information about the location of an AWS Lambda deployment revision stored as a RawString.

          • content (string) --

            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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

        • appSpecContent (dict) --

          The content of an AppSpec file for an AWS Lambda or Amazon ECS deployment. The content is formatted as JSON or YAML and stored as a RawString.

          • content (string) --

            The YAML-formatted or JSON-formatted revision string.

            For an AWS 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.

          • sha256 (string) --

            The SHA256 hash value of the revision content.

      • triggerConfigurations (list) --

        Information about triggers associated with the deployment group.

        • (dict) --

          Information about notification triggers for the deployment group.

          • triggerName (string) --

            The name of the notification trigger.

          • triggerTargetArn (string) --

            The Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic through which notifications about deployment or instance events are sent.

          • triggerEvents (list) --

            The event type or types for which notifications are triggered.

            • (string) --

      • alarmConfiguration (dict) --

        A list of alarms associated with the deployment group.

        • enabled (boolean) --

          Indicates whether the alarm configuration is enabled.

        • ignorePollAlarmFailure (boolean) --

          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.

        • alarms (list) --

          A list of alarms configured for the deployment group. A maximum of 10 alarms can be added to a deployment group.

          • (dict) --

            Information about an alarm.

            • name (string) --

              The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.

      • autoRollbackConfiguration (dict) --

        Information about the automatic rollback configuration associated with the deployment group.

        • enabled (boolean) --

          Indicates whether a defined automatic rollback configuration is currently enabled.

        • events (list) --

          The event type or types that trigger a rollback.

          • (string) --

      • deploymentStyle (dict) --

        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.

        • deploymentType (string) --

          Indicates whether to run an in-place deployment or a blue/green deployment.

        • deploymentOption (string) --

          Indicates whether to route deployment traffic behind a load balancer.

      • blueGreenDeploymentConfiguration (dict) --

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

        • terminateBlueInstancesOnDeploymentSuccess (dict) --

          Information about whether to terminate instances in the original fleet during a blue/green deployment.

          • action (string) --

            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.

          • terminationWaitTimeInMinutes (integer) --

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

        • deploymentReadyOption (dict) --

          Information about the action to take when newly provisioned instances are ready to receive traffic in a blue/green deployment.

          • actionOnTimeout (string) --

            Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.

            • CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately after the new application revision is installed on the instances in the replacement environment.

            • STOP_DEPLOYMENT: Do not register new instances with a load balancer unless traffic rerouting is started using ContinueDeployment . If traffic rerouting is not started before the end of the specified wait period, the deployment status is changed to Stopped.

          • waitTimeInMinutes (integer) --

            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 .

        • greenFleetProvisioningOption (dict) --

          Information about how instances are provisioned for a replacement environment in a blue/green deployment.

          • action (string) --

            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.

      • loadBalancerInfo (dict) --

        Information about the load balancer to use in a deployment.

        • elbInfoList (list) --

          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.

          • (dict) --

            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.

            • name (string) --

              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.

        • targetGroupInfoList (list) --

          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.

          • (dict) --

            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.

            • name (string) --

              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.

        • targetGroupPairInfoList (list) --

          The target group pair information. This is an array of TargeGroupPairInfo objects with a maximum size of one.

          • (dict) --

            Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.

            • targetGroups (list) --

              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.

              • (dict) --

                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.

                • name (string) --

                  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.

            • prodTrafficRoute (dict) --

              The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.

              • listenerArns (list) --

                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.

                • (string) --

            • testTrafficRoute (dict) --

              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.

              • listenerArns (list) --

                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.

                • (string) --

      • lastSuccessfulDeployment (dict) --

        Information about the most recent successful deployment to the deployment group.

        • deploymentId (string) --

          The unique ID of a deployment.

        • status (string) --

          The status of the most recent deployment.

        • endTime (datetime) --

          A timestamp that indicates when the most recent deployment to the deployment group was complete.

        • createTime (datetime) --

          A timestamp that indicates when the most recent deployment to the deployment group started.

      • lastAttemptedDeployment (dict) --

        Information about the most recent attempted deployment to the deployment group.

        • deploymentId (string) --

          The unique ID of a deployment.

        • status (string) --

          The status of the most recent deployment.

        • endTime (datetime) --

          A timestamp that indicates when the most recent deployment to the deployment group was complete.

        • createTime (datetime) --

          A timestamp that indicates when the most recent deployment to the deployment group started.

      • ec2TagSet (dict) --

        Information about groups of tags applied to an EC2 instance. The deployment group includes only EC2 instances identified by all of the tag groups. Cannot be used in the same call as ec2TagFilters.

        • ec2TagSetList (list) --

          A list that contains other lists of 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.

          • (list) --

            • (dict) --

              Information about an EC2 tag filter.

              • Key (string) --

                The tag filter key.

              • Value (string) --

                The tag filter value.

              • Type (string) --

                The tag filter type:

                • KEY_ONLY : Key only.

                • VALUE_ONLY : Value only.

                • KEY_AND_VALUE : Key and value.

      • onPremisesTagSet (dict) --

        Information about groups of tags applied to an on-premises instance. The deployment group includes only on-premises instances identified by all the tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters.

        • onPremisesTagSetList (list) --

          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.

          • (list) --

            • (dict) --

              Information about an on-premises instance tag filter.

              • Key (string) --

                The on-premises instance tag filter key.

              • Value (string) --

                The on-premises instance tag filter value.

              • Type (string) --

                The on-premises instance tag filter type:

                • KEY_ONLY: Key only.

                • VALUE_ONLY: Value only.

                • KEY_AND_VALUE: Key and value.

      • computePlatform (string) --

        The destination platform type for the deployment (Lambda , Server , or ECS ).

      • ecsServices (list) --

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

        • (dict) --

          Contains the service and cluster names used to identify an Amazon ECS deployment's target.

          • serviceName (string) --

            The name of the target Amazon ECS service.

          • clusterName (string) --

            The name of the cluster that the Amazon ECS service is associated with.

GetDeploymentTarget (updated) Link ¶
Changes (response)
{'deploymentTarget': {'cloudFormationTarget': {'deploymentId': 'string',
                                               'lastUpdatedAt': 'timestamp',
                                               'lifecycleEvents': [{'diagnostics': {'errorCode': 'Success '
                                                                                                 '| '
                                                                                                 'ScriptMissing '
                                                                                                 '| '
                                                                                                 'ScriptNotExecutable '
                                                                                                 '| '
                                                                                                 'ScriptTimedOut '
                                                                                                 '| '
                                                                                                 'ScriptFailed '
                                                                                                 '| '
                                                                                                 'UnknownError',
                                                                                    'logTail': 'string',
                                                                                    'message': 'string',
                                                                                    'scriptName': 'string'},
                                                                    'endTime': 'timestamp',
                                                                    'lifecycleEventName': 'string',
                                                                    'startTime': 'timestamp',
                                                                    'status': 'Pending '
                                                                              '| '
                                                                              'InProgress '
                                                                              '| '
                                                                              'Succeeded '
                                                                              '| '
                                                                              'Failed '
                                                                              '| '
                                                                              'Skipped '
                                                                              '| '
                                                                              'Unknown'}],
                                               'resourceType': 'string',
                                               'status': 'Pending | InProgress '
                                                         '| Succeeded | Failed '
                                                         '| Skipped | Unknown '
                                                         '| Ready',
                                               'targetId': 'string',
                                               'targetVersionWeight': 'double'},
                      'deploymentTargetType': {'CloudFormationTarget'}}}

Returns information about a deployment target.

See also: AWS API Documentation

Request Syntax

client.get_deployment_target(
    deploymentId='string',
    targetId='string'
)
type deploymentId

string

param deploymentId

The unique ID of a deployment.

type targetId

string

param targetId

The unique ID of a deployment target.

rtype

dict

returns

Response Syntax

{
    'deploymentTarget': {
        'deploymentTargetType': 'InstanceTarget'|'LambdaTarget'|'ECSTarget'|'CloudFormationTarget',
        'instanceTarget': {
            'deploymentId': 'string',
            'targetId': 'string',
            'targetArn': 'string',
            'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
            'lastUpdatedAt': datetime(2015, 1, 1),
            'lifecycleEvents': [
                {
                    'lifecycleEventName': 'string',
                    'diagnostics': {
                        'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                        'scriptName': 'string',
                        'message': 'string',
                        'logTail': 'string'
                    },
                    'startTime': datetime(2015, 1, 1),
                    'endTime': datetime(2015, 1, 1),
                    'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                },
            ],
            'instanceLabel': 'Blue'|'Green'
        },
        'lambdaTarget': {
            'deploymentId': 'string',
            'targetId': 'string',
            'targetArn': 'string',
            'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
            'lastUpdatedAt': datetime(2015, 1, 1),
            'lifecycleEvents': [
                {
                    'lifecycleEventName': 'string',
                    'diagnostics': {
                        'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                        'scriptName': 'string',
                        'message': 'string',
                        'logTail': 'string'
                    },
                    'startTime': datetime(2015, 1, 1),
                    'endTime': datetime(2015, 1, 1),
                    'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                },
            ],
            'lambdaFunctionInfo': {
                'functionName': 'string',
                'functionAlias': 'string',
                'currentVersion': 'string',
                'targetVersion': 'string',
                'targetVersionWeight': 123.0
            }
        },
        'ecsTarget': {
            'deploymentId': 'string',
            'targetId': 'string',
            'targetArn': 'string',
            'lastUpdatedAt': datetime(2015, 1, 1),
            'lifecycleEvents': [
                {
                    'lifecycleEventName': 'string',
                    'diagnostics': {
                        'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                        'scriptName': 'string',
                        'message': 'string',
                        'logTail': 'string'
                    },
                    'startTime': datetime(2015, 1, 1),
                    'endTime': datetime(2015, 1, 1),
                    'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                },
            ],
            'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
            'taskSetsInfo': [
                {
                    'identifer': 'string',
                    'desiredCount': 123,
                    'pendingCount': 123,
                    'runningCount': 123,
                    'status': 'string',
                    'trafficWeight': 123.0,
                    'targetGroup': {
                        'name': 'string'
                    },
                    'taskSetLabel': 'Blue'|'Green'
                },
            ]
        },
        'cloudFormationTarget': {
            'deploymentId': 'string',
            'targetId': 'string',
            'lastUpdatedAt': datetime(2015, 1, 1),
            'lifecycleEvents': [
                {
                    'lifecycleEventName': 'string',
                    'diagnostics': {
                        'errorCode': 'Success'|'ScriptMissing'|'ScriptNotExecutable'|'ScriptTimedOut'|'ScriptFailed'|'UnknownError',
                        'scriptName': 'string',
                        'message': 'string',
                        'logTail': 'string'
                    },
                    'startTime': datetime(2015, 1, 1),
                    'endTime': datetime(2015, 1, 1),
                    'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'
                },
            ],
            'status': 'Pending'|'InProgress'|'Succeeded'|'Failed'|'Skipped'|'Unknown'|'Ready',
            'resourceType': 'string',
            'targetVersionWeight': 123.0
        }
    }
}

Response Structure

  • (dict) --

    • deploymentTarget (dict) --

      A deployment target that contains information about a deployment such as its status, lifecycle events, and when it was last updated. It also contains metadata about the deployment target. The deployment target metadata depends on the deployment target's type (instanceTarget , lambdaTarget , or ecsTarget ).

      • deploymentTargetType (string) --

        The deployment type that is specific to the deployment's compute platform or deployments initiated by a CloudFormation stack update.

      • instanceTarget (dict) --

        Information about the target for a deployment that uses the EC2/On-premises compute platform.

        • deploymentId (string) --

          The unique ID of a deployment.

        • targetId (string) --

          The unique ID of a deployment target that has a type of instanceTarget .

        • targetArn (string) --

          The Amazon Resource Name (ARN) of the target.

        • status (string) --

          The status an EC2/On-premises deployment's target instance.

        • lastUpdatedAt (datetime) --

          The date and time when the target instance was updated by a deployment.

        • lifecycleEvents (list) --

          The lifecycle events of the deployment to this target instance.

          • (dict) --

            Information about a deployment lifecycle event.

            • lifecycleEventName (string) --

              The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

            • diagnostics (dict) --

              Diagnostic information about the deployment lifecycle event.

              • errorCode (string) --

                The associated error code:

                • Success: The specified script ran.

                • ScriptMissing: The specified script was not found in the specified location.

                • ScriptNotExecutable: The specified script is not a recognized executable file type.

                • ScriptTimedOut: The specified script did not finish running in the specified time period.

                • ScriptFailed: The specified script failed to run as expected.

                • UnknownError: The specified script did not run for an unknown reason.

              • scriptName (string) --

                The name of the script.

              • message (string) --

                The message associated with the error.

              • logTail (string) --

                The last portion of the diagnostic log.

                If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

            • startTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event started.

            • endTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event ended.

            • status (string) --

              The deployment lifecycle event status:

              • Pending: The deployment lifecycle event is pending.

              • InProgress: The deployment lifecycle event is in progress.

              • Succeeded: The deployment lifecycle event ran successfully.

              • Failed: The deployment lifecycle event has failed.

              • Skipped: The deployment lifecycle event has been skipped.

              • Unknown: The deployment lifecycle event is unknown.

        • instanceLabel (string) --

          A label that identifies whether the instance is an original target (BLUE ) or a replacement target (GREEN ).

      • lambdaTarget (dict) --

        Information about the target for a deployment that uses the AWS Lambda compute platform.

        • deploymentId (string) --

          The unique ID of a deployment.

        • targetId (string) --

          The unique ID of a deployment target that has a type of lambdaTarget .

        • targetArn (string) --

          The Amazon Resource Name (ARN) of the target.

        • status (string) --

          The status an AWS Lambda deployment's target Lambda function.

        • lastUpdatedAt (datetime) --

          The date and time when the target Lambda function was updated by a deployment.

        • lifecycleEvents (list) --

          The lifecycle events of the deployment to this target Lambda function.

          • (dict) --

            Information about a deployment lifecycle event.

            • lifecycleEventName (string) --

              The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

            • diagnostics (dict) --

              Diagnostic information about the deployment lifecycle event.

              • errorCode (string) --

                The associated error code:

                • Success: The specified script ran.

                • ScriptMissing: The specified script was not found in the specified location.

                • ScriptNotExecutable: The specified script is not a recognized executable file type.

                • ScriptTimedOut: The specified script did not finish running in the specified time period.

                • ScriptFailed: The specified script failed to run as expected.

                • UnknownError: The specified script did not run for an unknown reason.

              • scriptName (string) --

                The name of the script.

              • message (string) --

                The message associated with the error.

              • logTail (string) --

                The last portion of the diagnostic log.

                If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

            • startTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event started.

            • endTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event ended.

            • status (string) --

              The deployment lifecycle event status:

              • Pending: The deployment lifecycle event is pending.

              • InProgress: The deployment lifecycle event is in progress.

              • Succeeded: The deployment lifecycle event ran successfully.

              • Failed: The deployment lifecycle event has failed.

              • Skipped: The deployment lifecycle event has been skipped.

              • Unknown: The deployment lifecycle event is unknown.

        • lambdaFunctionInfo (dict) --

          A LambdaFunctionInfo object that describes a target Lambda function.

          • functionName (string) --

            The name of a Lambda function.

          • functionAlias (string) --

            The alias of a Lambda function. For more information, see AWS Lambda Function Aliases in the AWS Lambda Developer Guide .

          • currentVersion (string) --

            The version of a Lambda function that production traffic points to.

          • targetVersion (string) --

            The version of a Lambda function that production traffic points to after the Lambda function is deployed.

          • targetVersionWeight (float) --

            The percentage of production traffic that the target version of a Lambda function receives.

      • ecsTarget (dict) --

        Information about the target for a deployment that uses the Amazon ECS compute platform.

        • deploymentId (string) --

          The unique ID of a deployment.

        • targetId (string) --

          The unique ID of a deployment target that has a type of ecsTarget .

        • targetArn (string) --

          The Amazon Resource Name (ARN) of the target.

        • lastUpdatedAt (datetime) --

          The date and time when the target Amazon ECS application was updated by a deployment.

        • lifecycleEvents (list) --

          The lifecycle events of the deployment to this target Amazon ECS application.

          • (dict) --

            Information about a deployment lifecycle event.

            • lifecycleEventName (string) --

              The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

            • diagnostics (dict) --

              Diagnostic information about the deployment lifecycle event.

              • errorCode (string) --

                The associated error code:

                • Success: The specified script ran.

                • ScriptMissing: The specified script was not found in the specified location.

                • ScriptNotExecutable: The specified script is not a recognized executable file type.

                • ScriptTimedOut: The specified script did not finish running in the specified time period.

                • ScriptFailed: The specified script failed to run as expected.

                • UnknownError: The specified script did not run for an unknown reason.

              • scriptName (string) --

                The name of the script.

              • message (string) --

                The message associated with the error.

              • logTail (string) --

                The last portion of the diagnostic log.

                If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

            • startTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event started.

            • endTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event ended.

            • status (string) --

              The deployment lifecycle event status:

              • Pending: The deployment lifecycle event is pending.

              • InProgress: The deployment lifecycle event is in progress.

              • Succeeded: The deployment lifecycle event ran successfully.

              • Failed: The deployment lifecycle event has failed.

              • Skipped: The deployment lifecycle event has been skipped.

              • Unknown: The deployment lifecycle event is unknown.

        • status (string) --

          The status an Amazon ECS deployment's target ECS application.

        • taskSetsInfo (list) --

          The ECSTaskSet objects associated with the ECS target.

          • (dict) --

            Information about a set of Amazon ECS tasks in an AWS CodeDeploy deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic. An AWS CodeDeploy application that uses the Amazon ECS compute platform deploys a containerized application in an Amazon ECS service as a task set.

            • identifer (string) --

              A unique ID of an ECSTaskSet .

            • desiredCount (integer) --

              The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set.

            • pendingCount (integer) --

              The number of tasks in the task set that are in the PENDING status during an Amazon ECS deployment. A task in the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time, or when it is restarted after being in the STOPPED state.

            • runningCount (integer) --

              The number of tasks in the task set that are in the RUNNING status during an Amazon ECS deployment. A task in the RUNNING state is running and ready for use.

            • status (string) --

              The status of the task set. There are three valid task set statuses:

              • PRIMARY : Indicates the task set is serving production traffic.

              • ACTIVE : Indicates the task set is not serving production traffic.

              • DRAINING : Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group.

            • trafficWeight (float) --

              The percentage of traffic served by this task set.

            • targetGroup (dict) --

              The target group associated with the task set. The target group is used by AWS CodeDeploy to manage traffic to a task set.

              • name (string) --

                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.

            • taskSetLabel (string) --

              A label that identifies whether the ECS task set is an original target (BLUE ) or a replacement target (GREEN ).

      • cloudFormationTarget (dict) --

        Information about the target to be updated by an AWS CloudFormation blue/green deployment. This target type is used for all deployments initiated by a CloudFormation stack update.

        • deploymentId (string) --

          The unique ID of an AWS CloudFormation blue/green deployment.

        • targetId (string) --

          The unique ID of a deployment target that has a type of CloudFormationTarget .

        • lastUpdatedAt (datetime) --

          The date and time when the target application was updated by an AWS CloudFormation blue/green deployment.

        • lifecycleEvents (list) --

          The lifecycle events of the AWS CloudFormation blue/green deployment to this target application.

          • (dict) --

            Information about a deployment lifecycle event.

            • lifecycleEventName (string) --

              The deployment lifecycle event name, such as ApplicationStop , BeforeInstall , AfterInstall , ApplicationStart , or ValidateService .

            • diagnostics (dict) --

              Diagnostic information about the deployment lifecycle event.

              • errorCode (string) --

                The associated error code:

                • Success: The specified script ran.

                • ScriptMissing: The specified script was not found in the specified location.

                • ScriptNotExecutable: The specified script is not a recognized executable file type.

                • ScriptTimedOut: The specified script did not finish running in the specified time period.

                • ScriptFailed: The specified script failed to run as expected.

                • UnknownError: The specified script did not run for an unknown reason.

              • scriptName (string) --

                The name of the script.

              • message (string) --

                The message associated with the error.

              • logTail (string) --

                The last portion of the diagnostic log.

                If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic log.

            • startTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event started.

            • endTime (datetime) --

              A timestamp that indicates when the deployment lifecycle event ended.

            • status (string) --

              The deployment lifecycle event status:

              • Pending: The deployment lifecycle event is pending.

              • InProgress: The deployment lifecycle event is in progress.

              • Succeeded: The deployment lifecycle event ran successfully.

              • Failed: The deployment lifecycle event has failed.

              • Skipped: The deployment lifecycle event has been skipped.

              • Unknown: The deployment lifecycle event is unknown.

        • status (string) --

          The status of an AWS CloudFormation blue/green deployment's target application.

        • resourceType (string) --

          The resource type for the AWS CloudFormation blue/green deployment.

        • targetVersionWeight (float) --

          The percentage of production traffic that the target version of an AWS CloudFormation blue/green deployment receives.

ListDeployments (updated) Link ¶
Changes (request)
{'externalId': 'string', 'includeOnlyStatuses': {'Baking'}}

Lists the deployments in a deployment group for an application registered with the IAM user or AWS account.

See also: AWS API Documentation

Request Syntax

client.list_deployments(
    applicationName='string',
    deploymentGroupName='string',
    externalId='string',
    includeOnlyStatuses=[
        'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
    ],
    createTimeRange={
        'start': datetime(2015, 1, 1),
        'end': datetime(2015, 1, 1)
    },
    nextToken='string'
)
type applicationName

string

param applicationName

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

Note

If applicationName is specified, then deploymentGroupName must be specified. If it is not specified, then deploymentGroupName must not be specified.

type deploymentGroupName

string

param deploymentGroupName

The name of a deployment group for the specified application.

Note

If deploymentGroupName is specified, then applicationName must be specified. If it is not specified, then applicationName must not be specified.

type externalId

string

param externalId

The unique ID of an external resource for returning deployments linked to the external resource.

type includeOnlyStatuses

list

param includeOnlyStatuses

A subset of deployments to list by status:

  • Created : Include created deployments in the resulting list.

  • Queued : Include queued deployments in the resulting list.

  • In Progress : Include in-progress deployments in the resulting list.

  • Succeeded : Include successful deployments in the resulting list.

  • Failed : Include failed deployments in the resulting list.

  • Stopped : Include stopped deployments in the resulting list.

  • (string) --

type createTimeRange

dict

param createTimeRange

A time range (start and end) for returning a subset of the list of deployments.

  • start (datetime) --

    The start time of the time range.

    Note

    Specify null to leave the start time open-ended.

  • end (datetime) --

    The end time of the time range.

    Note

    Specify null to leave the end time open-ended.

type nextToken

string

param nextToken

An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.

rtype

dict

returns

Response Syntax

{
    'deployments': [
        'string',
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a ListDeployments operation.

    • deployments (list) --

      A list of deployment IDs.

      • (string) --

    • nextToken (string) --

      If a large amount of information is returned, an identifier is also returned. It can be used in a subsequent list deployments call to return the next set of deployments in the list.