FunctionHook
- class aws_cdk.aws_autoscaling_hooktargets.FunctionHook(fn, encryption_key=None)
Bases:
objectUse a Lambda Function as a hook target.
Internally creates a Topic to make the connection.
- 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 import aws_autoscaling_hooktargets as autoscaling_hooktargets from aws_cdk import aws_kms as kms from aws_cdk import aws_lambda as lambda_ # function_: lambda.Function # key: kms.Key function_hook = autoscaling_hooktargets.FunctionHook(function_, key)
- Parameters:
Methods
- bind(_scope, *, lifecycle_hook, role=None)
If the
IRoledoes not exist inoptions, will create anIRoleand an SNS Topic and attach both to the lifecycle hook.If the
IRoledoes exist inoptions, will only create an SNS Topic and attach it to the lifecycle hook.- Parameters:
_scope (
Construct)lifecycle_hook (
LifecycleHook) – The lifecycle hook to attach to. [disable-awslint:ref-via-interface]role (
Optional[IRole]) – The role to use when attaching to the lifecycle hook. [disable-awslint:ref-via-interface] Default: : a role is not created unless the target arn is specified
- Return type: