Class: AWSCDK::CloudFormation::CfnLambdaHookProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_formation/cfn_lambda_hook_props.rb

Overview

Properties for defining a CfnLambdaHook.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_alias:, execution_role:, failure_mode:, hook_status:, lambda_function:, target_operations:, stack_filters: nil, target_filters: nil) ⇒ CfnLambdaHookProps

Returns a new instance of CfnLambdaHookProps.

Parameters:

  • _alias (String)

    The type name alias for the Hook. This alias must be unique per account and Region.

  • execution_role (String)

    The IAM role that the Hook assumes to invoke your Lambda function.

  • failure_mode (String)

    Specifies how the Hook responds when the Lambda function invoked by the Hook returns a FAILED response.

  • hook_status (String)

    Specifies if the Hook is ENABLED or DISABLED .

  • lambda_function (String)

    Specifies the Lambda function for the Hook. You can use:.

  • target_operations (Array<String>)

    Specifies the list of operations the Hook is run against.

  • stack_filters (AWSCDK::IResolvable, AWSCDK::CloudFormation::CfnLambdaHook::StackFiltersProperty, nil) (defaults to: nil)

    Specifies the stack level filters for the Hook.

  • target_filters (AWSCDK::IResolvable, AWSCDK::CloudFormation::CfnLambdaHook::TargetFiltersProperty, nil) (defaults to: nil)

    Specifies the target filters for the Hook.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 17

def initialize(_alias:, execution_role:, failure_mode:, hook_status:, lambda_function:, target_operations:, stack_filters: nil, target_filters: nil)
  @_alias = _alias
  Jsii::Type.check_type(@_alias, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alias")
  @execution_role = execution_role
  Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "executionRole")
  @failure_mode = failure_mode
  Jsii::Type.check_type(@failure_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "failureMode")
  @hook_status = hook_status
  Jsii::Type.check_type(@hook_status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hookStatus")
  @lambda_function = lambda_function
  Jsii::Type.check_type(@lambda_function, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lambdaFunction")
  @target_operations = target_operations
  Jsii::Type.check_type(@target_operations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "targetOperations")
  @stack_filters = stack_filters.is_a?(Hash) ? ::AWSCDK::CloudFormation::CfnLambdaHook::StackFiltersProperty.new(**stack_filters.transform_keys(&:to_sym)) : stack_filters
  Jsii::Type.check_type(@stack_filters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZvcm1hdGlvbi5DZm5MYW1iZGFIb29rLlN0YWNrRmlsdGVyc1Byb3BlcnR5In1dfX0=")), "stackFilters") unless @stack_filters.nil?
  @target_filters = target_filters.is_a?(Hash) ? ::AWSCDK::CloudFormation::CfnLambdaHook::TargetFiltersProperty.new(**target_filters.transform_keys(&:to_sym)) : target_filters
  Jsii::Type.check_type(@target_filters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZvcm1hdGlvbi5DZm5MYW1iZGFIb29rLlRhcmdldEZpbHRlcnNQcm9wZXJ0eSJ9XX19")), "targetFilters") unless @target_filters.nil?
end

Instance Attribute Details

#_aliasString (readonly)

The type name alias for the Hook. This alias must be unique per account and Region.

The alias must be in the form Name1::Name2::Name3 and must not begin with AWS . For example, Private::Lambda::MyTestHook .



42
43
44
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 42

def _alias
  @_alias
end

#execution_roleString (readonly)

The IAM role that the Hook assumes to invoke your Lambda function.



47
48
49
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 47

def execution_role
  @execution_role
end

#failure_modeString (readonly)

Specifies how the Hook responds when the Lambda function invoked by the Hook returns a FAILED response.

  • FAIL : Prevents the action from proceeding. This is helpful for enforcing strict compliance or security policies.
  • WARN : Issues warnings to users but allows actions to continue. This is useful for non-critical validations or informational checks.


55
56
57
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 55

def failure_mode
  @failure_mode
end

#hook_statusString (readonly)

Note:

Default: - "ENABLED"

Specifies if the Hook is ENABLED or DISABLED .



61
62
63
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 61

def hook_status
  @hook_status
end

#lambda_functionString (readonly)

Specifies the Lambda function for the Hook. You can use:.

  • The full Amazon Resource Name (ARN) without a suffix.
  • A qualified ARN with a version or alias suffix.


69
70
71
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 69

def lambda_function
  @lambda_function
end

#stack_filtersAWSCDK::IResolvable, ... (readonly)

Specifies the stack level filters for the Hook.

Example stack level filter in JSON:

"StackFilters": {"FilteringCriteria": "ALL", "StackNames": {"Exclude": [ "stack-1", "stack-2"]}}

Example stack level filter in YAML:

StackFilters: FilteringCriteria: ALL StackNames: Exclude: - stack-1 - stack-2



91
92
93
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 91

def stack_filters
  @stack_filters
end

#target_filtersAWSCDK::IResolvable, ... (readonly)

Specifies the target filters for the Hook.

Example target filter in JSON:

"TargetFilters": {"Actions": [ "CREATE", "UPDATE", "DELETE" ]}

Example target filter in YAML:

TargetFilters: Actions: - CREATE - UPDATE - DELETE



104
105
106
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 104

def target_filters
  @target_filters
end

#target_operationsArray<String> (readonly)

Specifies the list of operations the Hook is run against.

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

Valid values: STACK | RESOURCE | CHANGE_SET | CLOUD_CONTROL



78
79
80
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 78

def target_operations
  @target_operations
end

Class Method Details

.jsii_propertiesObject



106
107
108
109
110
111
112
113
114
115
116
117
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 106

def self.jsii_properties
  {
    :_alias => "alias",
    :execution_role => "executionRole",
    :failure_mode => "failureMode",
    :hook_status => "hookStatus",
    :lambda_function => "lambdaFunction",
    :target_operations => "targetOperations",
    :stack_filters => "stackFilters",
    :target_filters => "targetFilters",
  }
end

Instance Method Details

#to_jsiiObject



119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'cloud_formation/cfn_lambda_hook_props.rb', line 119

def to_jsii
  result = {}
  result.merge!({
    "alias" => @_alias,
    "executionRole" => @execution_role,
    "failureMode" => @failure_mode,
    "hookStatus" => @hook_status,
    "lambdaFunction" => @lambda_function,
    "targetOperations" => @target_operations,
    "stackFilters" => @stack_filters,
    "targetFilters" => @target_filters,
  })
  result.compact
end