Class: AWSCDK::RemovalPolicyProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::RemovalPolicyProps
- Defined in:
- removal_policy_props.rb
Overview
Properties for applying a removal policy.
Instance Attribute Summary collapse
-
#apply_to_resource_types ⇒ Array<String>?
readonly
Apply the removal policy only to specific resource types.
-
#exclude_resource_types ⇒ Array<String>?
readonly
Exclude specific resource types from the removal policy.
-
#priority ⇒ Numeric?
readonly
The priority to use when applying this policy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(apply_to_resource_types: nil, exclude_resource_types: nil, priority: nil) ⇒ RemovalPolicyProps
constructor
A new instance of RemovalPolicyProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(apply_to_resource_types: nil, exclude_resource_types: nil, priority: nil) ⇒ RemovalPolicyProps
Returns a new instance of RemovalPolicyProps.
10 11 12 13 14 15 16 17 |
# File 'removal_policy_props.rb', line 10 def initialize(apply_to_resource_types: nil, exclude_resource_types: nil, priority: nil) @apply_to_resource_types = apply_to_resource_types Jsii::Type.check_type(@apply_to_resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "applyToResourceTypes") unless @apply_to_resource_types.nil? @exclude_resource_types = exclude_resource_types Jsii::Type.check_type(@exclude_resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "excludeResourceTypes") unless @exclude_resource_types.nil? @priority = priority Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil? end |
Instance Attribute Details
#apply_to_resource_types ⇒ Array<String>? (readonly)
Default: - apply to all resources
Apply the removal policy only to specific resource types.
Can be a CloudFormation resource type string (e.g., 'AWS::S3::Bucket').
25 26 27 |
# File 'removal_policy_props.rb', line 25 def apply_to_resource_types @apply_to_resource_types end |
#exclude_resource_types ⇒ Array<String>? (readonly)
Default: - no exclusions
Exclude specific resource types from the removal policy.
Can be a CloudFormation resource type string (e.g., 'AWS::S3::Bucket').
32 33 34 |
# File 'removal_policy_props.rb', line 32 def exclude_resource_types @exclude_resource_types end |
#priority ⇒ Numeric? (readonly)
Default: - AspectPriority.MUTATING
The priority to use when applying this policy.
The priority affects only the order in which aspects are applied during synthesis. For RemovalPolicies, the last applied policy will override previous ones.
NOTE: Priority does NOT determine which policy "wins" when there are conflicts. The order of application determines the final policy, with later policies overriding earlier ones.
44 45 46 |
# File 'removal_policy_props.rb', line 44 def priority @priority end |
Class Method Details
.jsii_properties ⇒ Object
46 47 48 49 50 51 52 |
# File 'removal_policy_props.rb', line 46 def self.jsii_properties { :apply_to_resource_types => "applyToResourceTypes", :exclude_resource_types => "excludeResourceTypes", :priority => "priority", } end |
Instance Method Details
#to_jsii ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'removal_policy_props.rb', line 54 def to_jsii result = {} result.merge!({ "applyToResourceTypes" => @apply_to_resource_types, "excludeResourceTypes" => @exclude_resource_types, "priority" => @priority, }) result.compact end |