Class: AWSCDK::Rbin::CfnRuleProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
rbin/cfn_rule_props.rb

Overview

Properties for defining a CfnRule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:



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 = 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 = 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 = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

The retention rule description.



56
57
58
# File 'rbin/cfn_rule_props.rb', line 56

def description
  @description
end

#exclude_resource_tagsAWSCDK::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
  @exclude_resource_tags
end

#lock_configurationAWSCDK::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_tagsAWSCDK::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
  @resource_tags
end

#resource_typeString (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_periodAWSCDK::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

#statusString? (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

#tagsArray<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
  @tags
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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