CfnLambdaHookPropsMixin

class aws_cdk.mixins_preview.aws_cloudformation.mixins.CfnLambdaHookPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::CloudFormation::LambdaHook resource creates and activates a Lambda Hook.

You can use a Lambda Hook to evaluate your resources before allowing stack operations. This resource forwards requests for resource evaluation to a Lambda function.

For more information, see Lambda Hooks in the CloudFormation Hooks User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-lambdahook.html

CloudformationResource:

AWS::CloudFormation::LambdaHook

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

cfn_lambda_hook_props_mixin = cloudformation_mixins.CfnLambdaHookPropsMixin(cloudformation_mixins.CfnLambdaHookMixinProps(
    alias="alias",
    execution_role="executionRole",
    failure_mode="failureMode",
    hook_status="hookStatus",
    lambda_function="lambdaFunction",
    stack_filters=cloudformation_mixins.CfnLambdaHookPropsMixin.StackFiltersProperty(
        filtering_criteria="filteringCriteria",
        stack_names=cloudformation_mixins.CfnLambdaHookPropsMixin.StackNamesProperty(
            exclude=["exclude"],
            include=["include"]
        ),
        stack_roles=cloudformation_mixins.CfnLambdaHookPropsMixin.StackRolesProperty(
            exclude=["exclude"],
            include=["include"]
        )
    ),
    target_filters=cloudformation_mixins.CfnLambdaHookPropsMixin.TargetFiltersProperty(
        actions=["actions"],
        invocation_points=["invocationPoints"],
        target_names=["targetNames"],
        targets=[cloudformation_mixins.CfnLambdaHookPropsMixin.HookTargetProperty(
            action="action",
            invocation_point="invocationPoint",
            target_name="targetName"
        )]
    ),
    target_operations=["targetOperations"]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::CloudFormation::LambdaHook.

Parameters:
  • props (Union[CfnLambdaHookMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['alias', 'executionRole', 'failureMode', 'hookStatus', 'lambdaFunction', 'stackFilters', 'targetFilters', 'targetOperations']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

HookTargetProperty

class CfnLambdaHookPropsMixin.HookTargetProperty(*, action=None, invocation_point=None, target_name=None)

Bases: object

Hook targets are the destination where hooks will be invoked against.

Parameters:
  • action (Optional[str]) – Target actions are the type of operation hooks will be executed at.

  • invocation_point (Optional[str]) – Invocation points are the point in provisioning workflow where hooks will be executed.

  • target_name (Optional[str]) – Type name of hook target. Hook targets are the destination where hooks will be invoked against.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-hooktarget.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

hook_target_property = cloudformation_mixins.CfnLambdaHookPropsMixin.HookTargetProperty(
    action="action",
    invocation_point="invocationPoint",
    target_name="targetName"
)

Attributes

action

Target actions are the type of operation hooks will be executed at.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-hooktarget.html#cfn-cloudformation-lambdahook-hooktarget-action

invocation_point

Invocation points are the point in provisioning workflow where hooks will be executed.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-hooktarget.html#cfn-cloudformation-lambdahook-hooktarget-invocationpoint

target_name

Type name of hook target.

Hook targets are the destination where hooks will be invoked against.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-hooktarget.html#cfn-cloudformation-lambdahook-hooktarget-targetname

StackFiltersProperty

class CfnLambdaHookPropsMixin.StackFiltersProperty(*, filtering_criteria=None, stack_names=None, stack_roles=None)

Bases: object

The StackFilters property type specifies stack level filters for a Hook.

The StackNames or StackRoles properties are optional. However, you must specify at least one of these properties.

For more information, see CloudFormation Hooks stack level filters .

Parameters:
  • filtering_criteria (Optional[str]) – The filtering criteria. - All stack names and stack roles ( All ): The Hook will only be invoked when all specified filters match. - Any stack names and stack roles ( Any ): The Hook will be invoked if at least one of the specified filters match. Default: - “ALL”

  • stack_names (Union[IResolvable, StackNamesProperty, Dict[str, Any], None]) – Includes or excludes specific stacks from Hook invocations.

  • stack_roles (Union[IResolvable, StackRolesProperty, Dict[str, Any], None]) – Includes or excludes specific stacks from Hook invocations based on their associated IAM roles.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackfilters.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

stack_filters_property = cloudformation_mixins.CfnLambdaHookPropsMixin.StackFiltersProperty(
    filtering_criteria="filteringCriteria",
    stack_names=cloudformation_mixins.CfnLambdaHookPropsMixin.StackNamesProperty(
        exclude=["exclude"],
        include=["include"]
    ),
    stack_roles=cloudformation_mixins.CfnLambdaHookPropsMixin.StackRolesProperty(
        exclude=["exclude"],
        include=["include"]
    )
)

Attributes

filtering_criteria

The filtering criteria.

  • All stack names and stack roles ( All ): The Hook will only be invoked when all specified filters match.

  • Any stack names and stack roles ( Any ): The Hook will be invoked if at least one of the specified filters match.

Default:
  • “ALL”

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackfilters.html#cfn-cloudformation-lambdahook-stackfilters-filteringcriteria

stack_names

Includes or excludes specific stacks from Hook invocations.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackfilters.html#cfn-cloudformation-lambdahook-stackfilters-stacknames

stack_roles

Includes or excludes specific stacks from Hook invocations based on their associated IAM roles.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackfilters.html#cfn-cloudformation-lambdahook-stackfilters-stackroles

StackNamesProperty

class CfnLambdaHookPropsMixin.StackNamesProperty(*, exclude=None, include=None)

Bases: object

Specifies the stack names for the StackFilters property type to include or exclude specific stacks from Hook invocations.

For more information, see CloudFormation Hooks stack level filters .

Parameters:
  • exclude (Optional[Sequence[str]]) – The stack names to exclude. All stacks except those listed here will invoke the Hook.

  • include (Optional[Sequence[str]]) – The stack names to include. Only the stacks specified in this list will invoke the Hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stacknames.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

stack_names_property = cloudformation_mixins.CfnLambdaHookPropsMixin.StackNamesProperty(
    exclude=["exclude"],
    include=["include"]
)

Attributes

exclude

The stack names to exclude.

All stacks except those listed here will invoke the Hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stacknames.html#cfn-cloudformation-lambdahook-stacknames-exclude

include

The stack names to include.

Only the stacks specified in this list will invoke the Hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stacknames.html#cfn-cloudformation-lambdahook-stacknames-include

StackRolesProperty

class CfnLambdaHookPropsMixin.StackRolesProperty(*, exclude=None, include=None)

Bases: object

Specifies the stack roles for the StackFilters property type to include or exclude specific stacks from Hook invocations based on their associated IAM roles.

For more information, see CloudFormation Hooks stack level filters .

Parameters:
  • exclude (Optional[Sequence[str]]) – The IAM role ARNs for stacks you want to exclude. The Hook will be invoked on all stacks except those initiated by the specified roles.

  • include (Optional[Sequence[str]]) – The IAM role ARNs to target stacks associated with these roles. Only stack operations initiated by these roles will invoke the Hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackroles.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

stack_roles_property = cloudformation_mixins.CfnLambdaHookPropsMixin.StackRolesProperty(
    exclude=["exclude"],
    include=["include"]
)

Attributes

exclude

The IAM role ARNs for stacks you want to exclude.

The Hook will be invoked on all stacks except those initiated by the specified roles.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackroles.html#cfn-cloudformation-lambdahook-stackroles-exclude

include

The IAM role ARNs to target stacks associated with these roles.

Only stack operations initiated by these roles will invoke the Hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-stackroles.html#cfn-cloudformation-lambdahook-stackroles-include

TargetFiltersProperty

class CfnLambdaHookPropsMixin.TargetFiltersProperty(*, actions=None, invocation_points=None, target_names=None, targets=None)

Bases: object

The TargetFilters property type specifies the target filters for the Hook.

For more information, see CloudFormation Hook target filters .

Parameters:
  • actions (Optional[Sequence[str]]) – List of actions that the hook is going to target.

  • invocation_points (Optional[Sequence[str]]) – List of invocation points that the hook is going to target.

  • target_names (Optional[Sequence[str]]) – List of type names that the hook is going to target.

  • targets (Union[IResolvable, Sequence[Union[IResolvable, HookTargetProperty, Dict[str, Any]]], None]) – List of hook targets.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-targetfilters.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudformation import mixins as cloudformation_mixins

target_filters_property = cloudformation_mixins.CfnLambdaHookPropsMixin.TargetFiltersProperty(
    actions=["actions"],
    invocation_points=["invocationPoints"],
    target_names=["targetNames"],
    targets=[cloudformation_mixins.CfnLambdaHookPropsMixin.HookTargetProperty(
        action="action",
        invocation_point="invocationPoint",
        target_name="targetName"
    )]
)

Attributes

actions

List of actions that the hook is going to target.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-targetfilters.html#cfn-cloudformation-lambdahook-targetfilters-actions

invocation_points

List of invocation points that the hook is going to target.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-targetfilters.html#cfn-cloudformation-lambdahook-targetfilters-invocationpoints

target_names

List of type names that the hook is going to target.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-targetfilters.html#cfn-cloudformation-lambdahook-targetfilters-targetnames

targets

List of hook targets.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-lambdahook-targetfilters.html#cfn-cloudformation-lambdahook-targetfilters-targets