Class: AWSCDK::Rbin::CfnRuleProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Rbin::CfnRuleProps
- Defined in:
- rbin/cfn_rule_props.rb
Overview
Properties for defining a CfnRule.
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
The retention rule description.
-
#exclude_resource_tags ⇒ AWSCDK::IResolvable, ...
readonly
[Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule.
-
#lock_configuration ⇒ AWSCDK::IResolvable, ...
readonly
Information about the retention rule lock configuration.
-
#resource_tags ⇒ AWSCDK::IResolvable, ...
readonly
[Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule.
-
#resource_type ⇒ String
readonly
The resource type to be retained by the retention rule.
-
#retention_period ⇒ AWSCDK::IResolvable, AWSCDK::Rbin::CfnRule::RetentionPeriodProperty
readonly
Information about the retention period for which the retention rule is to retain resources.
-
#status ⇒ String?
readonly
The state of the retention rule.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
Information about the tags to assign to the retention rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resource_type:, retention_period:, description: nil, exclude_resource_tags: nil, lock_configuration: nil, resource_tags: nil, status: nil, tags: nil) ⇒ CfnRuleProps
constructor
A new instance of CfnRuleProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(resource_type:, retention_period:, description: nil, exclude_resource_tags: nil, lock_configuration: nil, resource_tags: nil, status: nil, tags: nil) ⇒ CfnRuleProps
Returns a new instance of CfnRuleProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'rbin/cfn_rule_props.rb', line 17 def initialize(resource_type:, retention_period:, description: nil, exclude_resource_tags: nil, lock_configuration: nil, resource_tags: nil, status: nil, tags: nil) @resource_type = resource_type Jsii::Type.check_type(@resource_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceType") @retention_period = retention_period.is_a?(Hash) ? ::AWSCDK::Rbin::CfnRule::RetentionPeriodProperty.new(**retention_period.transform_keys(&:to_sym)) : retention_period Jsii::Type.check_type(@retention_period, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19yYmluLkNmblJ1bGUuUmV0ZW50aW9uUGVyaW9kUHJvcGVydHkifV19fQ==")), "retentionPeriod") @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @exclude_resource_tags = Jsii::Type.check_type(@exclude_resource_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmJpbi5DZm5SdWxlLlJlc291cmNlVGFnUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "excludeResourceTags") unless @exclude_resource_tags.nil? @lock_configuration = lock_configuration.is_a?(Hash) ? ::AWSCDK::Rbin::CfnRule::UnlockDelayProperty.new(**lock_configuration.transform_keys(&:to_sym)) : lock_configuration Jsii::Type.check_type(@lock_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19yYmluLkNmblJ1bGUuVW5sb2NrRGVsYXlQcm9wZXJ0eSJ9XX19")), "lockConfiguration") unless @lock_configuration.nil? @resource_tags = Jsii::Type.check_type(@resource_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmJpbi5DZm5SdWxlLlJlc291cmNlVGFnUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "resourceTags") unless @resource_tags.nil? @status = status Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "status") unless @status.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#description ⇒ String? (readonly)
The retention rule description.
56 57 58 |
# File 'rbin/cfn_rule_props.rb', line 56 def description @description end |
#exclude_resource_tags ⇒ AWSCDK::IResolvable, ... (readonly)
[Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule.
Resources that have any of these tags are not retained by the retention rule upon deletion.
You can't specify exclusion tags for tag-level retention rules.
65 66 67 |
# File 'rbin/cfn_rule_props.rb', line 65 def @exclude_resource_tags end |
#lock_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
Information about the retention rule lock configuration.
70 71 72 |
# File 'rbin/cfn_rule_props.rb', line 70 def lock_configuration @lock_configuration end |
#resource_tags ⇒ AWSCDK::IResolvable, ... (readonly)
[Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule.
For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.
You can add the same tag key and value pair to a maximum or five retention rules.
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.
81 82 83 |
# File 'rbin/cfn_rule_props.rb', line 81 def @resource_tags end |
#resource_type ⇒ String (readonly)
The resource type to be retained by the retention rule.
Currently, only EBS volumes, EBS snapshots, and EBS-backed AMIs are supported.
- To retain EBS volumes, specify
EBS_VOLUME. - To retain EBS snapshots, specify
EBS_SNAPSHOT - To retain EBS-backed AMIs, specify
EC2_IMAGE.
46 47 48 |
# File 'rbin/cfn_rule_props.rb', line 46 def resource_type @resource_type end |
#retention_period ⇒ AWSCDK::IResolvable, AWSCDK::Rbin::CfnRule::RetentionPeriodProperty (readonly)
Information about the retention period for which the retention rule is to retain resources.
51 52 53 |
# File 'rbin/cfn_rule_props.rb', line 51 def retention_period @retention_period end |
#status ⇒ String? (readonly)
The state of the retention rule.
Only retention rules that are in the available state retain resources.
88 89 90 |
# File 'rbin/cfn_rule_props.rb', line 88 def status @status end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
Information about the tags to assign to the retention rule.
93 94 95 |
# File 'rbin/cfn_rule_props.rb', line 93 def @tags end |
Class Method Details
.jsii_properties ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'rbin/cfn_rule_props.rb', line 95 def self.jsii_properties { :resource_type => "resourceType", :retention_period => "retentionPeriod", :description => "description", :exclude_resource_tags => "excludeResourceTags", :lock_configuration => "lockConfiguration", :resource_tags => "resourceTags", :status => "status", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'rbin/cfn_rule_props.rb', line 108 def to_jsii result = {} result.merge!({ "resourceType" => @resource_type, "retentionPeriod" => @retention_period, "description" => @description, "excludeResourceTags" => @exclude_resource_tags, "lockConfiguration" => @lock_configuration, "resourceTags" => @resource_tags, "status" => @status, "tags" => @tags, }) result.compact end |