Class: AWSCDK::Autoscaling::BindHookTargetOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/bind_hook_target_options.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lifecycle_hook:, role: nil) ⇒ BindHookTargetOptions

Returns a new instance of BindHookTargetOptions.

Parameters:



11
12
13
14
15
16
# File 'autoscaling/bind_hook_target_options.rb', line 11

def initialize(lifecycle_hook:, role: nil)
  @lifecycle_hook = lifecycle_hook
  Jsii::Type.check_type(@lifecycle_hook, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTGlmZWN5Y2xlSG9vayJ9")), "lifecycleHook")
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

#lifecycle_hookAWSCDK::Autoscaling::LifecycleHook (readonly)

The lifecycle hook to attach to.

[disable-awslint:ref-via-interface]



23
24
25
# File 'autoscaling/bind_hook_target_options.rb', line 23

def lifecycle_hook
  @lifecycle_hook
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

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

The role to use when attaching to the lifecycle hook.

[disable-awslint:ref-via-interface]

Returns:



30
31
32
# File 'autoscaling/bind_hook_target_options.rb', line 30

def role
  @role
end

Class Method Details

.jsii_propertiesObject



32
33
34
35
36
37
# File 'autoscaling/bind_hook_target_options.rb', line 32

def self.jsii_properties
  {
    :lifecycle_hook => "lifecycleHook",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



39
40
41
42
43
44
45
46
# File 'autoscaling/bind_hook_target_options.rb', line 39

def to_jsii
  result = {}
  result.merge!({
    "lifecycleHook" => @lifecycle_hook,
    "role" => @role,
  })
  result.compact
end