PipelineDeployStackAction

class aws_cdk.app_delivery.PipelineDeployStackAction(*, admin_permissions, input, stack, capabilities=None, change_set_name=None, create_change_set_run_order=None, execute_change_set_run_order=None, role=None)

Bases: object

A class to deploy a stack that is part of a CDK App, using CodePipeline. This composite Action takes care of preparing and executing a CloudFormation ChangeSet.

It currently does not support stacks that make use of ``Asset``s, and requires the deployed stack is in the same account and region where the CodePipeline is hosted.

stability :stability: experimental

__init__(*, admin_permissions, input, stack, capabilities=None, change_set_name=None, create_change_set_run_order=None, execute_change_set_run_order=None, role=None)
Parameters
  • props

  • admin_permissions (bool) – Whether to grant admin permissions to CloudFormation while deploying this template. Setting this to true affects the defaults for role and capabilities, if you don’t specify any alternatives. The default role that will be created for you will have admin (i.e., *) permissions on all resources, and the deployment will have named IAM capabilities (i.e., able to create all IAM resources). This is a shorthand that you can use if you fully trust the templates that are deployed in this pipeline. If you want more fine-grained permissions, use addToRolePolicy and capabilities to control what the CloudFormation deployment is allowed to do.

  • input (Artifact) – The CodePipeline artifact that holds the synthesized app, which is the contents of the <directory> when running cdk synth -o <directory>.

  • stack (Stack) – The CDK stack to be deployed.

  • capabilities (Optional[List[CloudFormationCapabilities]]) – Acknowledge certain changes made as part of deployment. For stacks that contain certain resources, explicit acknowledgement that AWS CloudFormation might create or update those resources. For example, you must specify AnonymousIAM if your stack template contains AWS Identity and Access Management (IAM) resources. For more information Default: [AnonymousIAM, AutoExpand], unless adminPermissions is true

  • change_set_name (Optional[str]) – The name to use when creating a ChangeSet for the stack. Default: CDK-CodePipeline-ChangeSet

  • create_change_set_run_order (Union[int, float, None]) – The runOrder for the CodePipeline action creating the ChangeSet. Default: 1

  • execute_change_set_run_order (Union[int, float, None]) – The runOrder for the CodePipeline action executing the ChangeSet. Default: createChangeSetRunOrder + 1

  • role (Optional[IRole]) – IAM role to assume when deploying changes. If not specified, a fresh role is created. The role is created with zero permissions unless adminPermissions is true, in which case the role will have admin permissions. Default: A fresh role with admin or no permissions (depending on the value of adminPermissions).

stability :stability: experimental

Return type

None

Methods

add_to_deployment_role_policy(statement)

Add policy statements to the role deploying the stack.

This role is passed to CloudFormation and must have the IAM permissions necessary to deploy the stack or you can grant this role adminPermissions by using that option during creation. If you do not grant adminPermissions you need to identify the proper statements to add to this role based on the CloudFormation Resources in your stack.

Parameters

statement (PolicyStatement) –

stability :stability: experimental

Return type

None

bind(scope, stage, *, bucket, role)
Parameters

stability :stability: experimental

Return type

ActionConfig

on_state_change(name, target=None, *, description=None, enabled=None, event_pattern=None, rule_name=None, schedule=None, targets=None)
Parameters
  • name (str) –

  • target (Optional[IRuleTarget]) –

  • options

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description.

  • enabled (Optional[bool]) – Indicates whether the rule is enabled. Default: true

  • event_pattern (Optional[EventPattern]) – Describes which events CloudWatch Events routes to the specified target. These routed events are matched events. For more information, see Events and Event Patterns in the Amazon CloudWatch User Guide. Default: - None.

  • rule_name (Optional[str]) – A name for the rule. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.

  • schedule (Optional[Schedule]) – The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide. Default: - None.

  • targets (Optional[List[IRuleTarget]]) – Targets to invoke when this rule matches an event. Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]). Default: - No targets.

stability :stability: experimental

Return type

Rule

Attributes

action_properties

stability :stability: experimental

Return type

ActionProperties

deployment_role

stability :stability: experimental

Return type

IRole