CodeDeploy / Client / batch_get_deployment_groups

batch_get_deployment_groups#

CodeDeploy.Client.batch_get_deployment_groups(**kwargs)#

Gets information about one or more deployment groups.

See also: AWS API Documentation

Request Syntax

response = client.batch_get_deployment_groups(
    applicationName='string',
    deploymentGroupNames=[
        'string',
    ]
)
Parameters:
  • applicationName (string) –

    [REQUIRED]

    The name of an CodeDeploy application associated with the applicable IAM or Amazon Web Services account.

  • deploymentGroupNames (list) –

    [REQUIRED]

    The names of the deployment groups.

    • (string) –

Return type:

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'
            },
            'outdatedInstancesStrategy': 'UPDATE'|'IGNORE',
            '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 Amazon Web Services services on your behalf. For more information, see Create a Service Role for CodeDeploy in the 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 (Lambda deployments only).

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

          • 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 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 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 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 or deployment group. A maximum of 10 alarms can be added.

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

        • outdatedInstancesStrategy (string) –

          Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision.

          If this option is set to UPDATE or is unspecified, CodeDeploy initiates one or more ‘auto-update outdated instances’ deployments to apply the deployed application revision to the new Amazon EC2 instances.

          If this option is set to IGNORE, CodeDeploy does not initiate a deployment to update the new Amazon EC2 instances. This may result in instances having different revisions.

        • 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 Amazon EC2 instance. The deployment group includes only Amazon 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 Amazon EC2 instance tag groups. For an instance to be included in the deployment group, it must be identified by all of the tag groups in the list.

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

Exceptions

  • CodeDeploy.Client.exceptions.ApplicationNameRequiredException

  • CodeDeploy.Client.exceptions.InvalidApplicationNameException

  • CodeDeploy.Client.exceptions.ApplicationDoesNotExistException

  • CodeDeploy.Client.exceptions.DeploymentGroupNameRequiredException

  • CodeDeploy.Client.exceptions.InvalidDeploymentGroupNameException

  • CodeDeploy.Client.exceptions.BatchLimitExceededException

  • CodeDeploy.Client.exceptions.DeploymentConfigDoesNotExistException