Skip to content
v2.278.0

BindHookTargetOptions Struct ​

Options needed to bind a target to a lifecycle hook.

[disable-awslint:ref-via-interface] The lifecycle hook to attach to and an IRole to use

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const lifecycleHook: autoscaling.LifecycleHook;
declare const role: iam.Role;
const bindHookTargetOptions: autoscaling.BindHookTargetOptions = {
  lifecycleHook: lifecycleHook,

  // the properties below are optional
  role: role,
};
python
# 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 as autoscaling
from aws_cdk import aws_iam as iam

# lifecycle_hook: autoscaling.LifecycleHook
# role: iam.Role

bind_hook_target_options = autoscaling.BindHookTargetOptions(
    lifecycle_hook=lifecycle_hook,

    # the properties below are optional
    role=role
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscaling.*;
import software.amazon.awscdk.services.iam.*;

LifecycleHook lifecycleHook;
Role role;

BindHookTargetOptions bindHookTargetOptions = BindHookTargetOptions.builder()
        .lifecycleHook(lifecycleHook)

        // the properties below are optional
        .role(role)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.IAM;

LifecycleHook lifecycleHook;
Role role;

var bindHookTargetOptions = new BindHookTargetOptions {
    LifecycleHook = lifecycleHook,

    // the properties below are optional
    Role = role
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var lifecycleHook LifecycleHook
var role Role

bindHookTargetOptions := &BindHookTargetOptions{
	LifecycleHook: lifecycleHook,

	// the properties below are optional
	Role: role,
}

Properties ​

lifecycleHookLifecycleHooklifecycle_hookLifecycleHooklifecycleHookLifecycleHookLifecycleHookLifecycleHookLifecycleHookLifecycleHook required #
The lifecycle hook to attach to.

[disable-awslint:ref-via-interface]

roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole #
The role to use when attaching to the lifecycle hook.

Default: : a role is not created unless the target arn is specified

[disable-awslint:ref-via-interface]