LambdaDeploymentGroup

class aws_cdk.aws_codedeploy.LambdaDeploymentGroup(scope, id, *, alias, alarms=None, application=None, auto_rollback=None, deployment_config=None, deployment_group_name=None, ignore_poll_alarms_failure=None, post_hook=None, pre_hook=None, role=None)

Bases: aws_cdk.core.Resource

resource: :resource:: AWS::CodeDeploy::DeploymentGroup

__init__(scope, id, *, alias, alarms=None, application=None, auto_rollback=None, deployment_config=None, deployment_group_name=None, ignore_poll_alarms_failure=None, post_hook=None, pre_hook=None, role=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • alias (Alias) – Lambda Alias to shift traffic. Updating the version of the alias will trigger a CodeDeploy deployment. [disable-awslint:ref-via-interface] since we need to modify the alias CFN resource update policy

  • alarms (Optional[List[IAlarm]]) – The CloudWatch alarms associated with this Deployment Group. CodeDeploy will stop (and optionally roll back) a deployment if during it any of the alarms trigger. Alarms can also be added after the Deployment Group is created using the {@link #addAlarm} method. Default: []

  • application (Optional[ILambdaApplication]) – The reference to the CodeDeploy Lambda Application that this Deployment Group belongs to. Default: - One will be created for you.

  • auto_rollback (Optional[AutoRollbackConfig]) – The auto-rollback configuration for this Deployment Group. Default: - default AutoRollbackConfig.

  • deployment_config (Optional[ILambdaDeploymentConfig]) – The Deployment Configuration this Deployment Group uses. Default: LambdaDeploymentConfig.CANARY_10PERCENT_5MINUTES

  • deployment_group_name (Optional[str]) – The physical, human-readable name of the CodeDeploy Deployment Group. Default: - An auto-generated name will be used.

  • ignore_poll_alarms_failure (Optional[bool]) – Whether to continue a deployment even if fetching the alarm status from CloudWatch failed. Default: false

  • post_hook (Optional[IFunction]) – The Lambda function to run after traffic routing starts. Default: - None.

  • pre_hook (Optional[IFunction]) – The Lambda function to run before traffic routing starts. Default: - None.

  • role (Optional[IRole]) – The service Role of this Deployment Group. Default: - A new Role will be created.

Return type

None

Methods

add_alarm(alarm)

Associates an additional alarm with this Deployment Group.

Parameters

alarm (IAlarm) – the alarm to associate with this Deployment Group.

Return type

None

add_post_hook(post_hook)

Associate a function to run after deployment completes.

Parameters

post_hook (IFunction) – function to run after deployment completes.

throws: :throws:: an error if a post-hook function is already configured

Return type

None

add_pre_hook(pre_hook)

Associate a function to run before deployment begins.

Parameters

pre_hook (IFunction) – function to run before deployment beings.

throws: :throws:: an error if a pre-hook function is already configured

Return type

None

grant_put_lifecycle_event_hook_execution_status(grantee)

Grant a principal permission to codedeploy:PutLifecycleEventHookExecutionStatus on this deployment group resource.

Parameters

grantee (IGrantable) – to grant permission to.

Return type

Grant

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

application

The reference to the CodeDeploy Lambda Application that this Deployment Group belongs to.

Return type

ILambdaApplication

deployment_config

The Deployment Configuration this Group uses.

Return type

ILambdaDeploymentConfig

deployment_group_arn

The ARN of this Deployment Group.

Return type

str

deployment_group_name

The physical name of the CodeDeploy Deployment Group.

Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

role
Return type

IRole

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_lambda_deployment_group_attributes(scope, id, *, application, deployment_group_name, deployment_config=None)

Import an Lambda Deployment Group defined either outside the CDK app, or in a different AWS region.

Parameters
  • scope (Construct) – the parent Construct for this new Construct.

  • id (str) – the logical ID of this new Construct.

  • attrs – the properties of the referenced Deployment Group.

  • application (ILambdaApplication) – The reference to the CodeDeploy Lambda Application that this Deployment Group belongs to.

  • deployment_group_name (str) – The physical, human-readable name of the CodeDeploy Lambda Deployment Group that we are referencing.

  • deployment_config (Optional[ILambdaDeploymentConfig]) – The Deployment Configuration this Deployment Group uses. Default: LambdaDeploymentConfig.CANARY_10PERCENT_5MINUTES

return :rtype: ILambdaDeploymentGroup :return: a Construct representing a reference to an existing Deployment Group

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool