Class: AWSCDK::ImageBuilder::CfnLifecyclePolicy::FilterProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ImageBuilder::CfnLifecyclePolicy::FilterProperty
- Defined in:
- image_builder/cfn_lifecycle_policy.rb
Overview
Defines filters that the lifecycle policy uses to determine impacted resource.
Instance Attribute Summary collapse
-
#retain_at_least ⇒ Numeric?
readonly
For age-based filters, this is the number of resources to keep on hand after the lifecycle
DELETEaction is applied. -
#type ⇒ String
readonly
Filter resources based on either
ageorcount. -
#unit ⇒ String?
readonly
Defines the unit of time that the lifecycle policy uses to determine impacted resources.
-
#value ⇒ Numeric
readonly
The number of units for the time period or for the count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, value:, retain_at_least: nil, unit: nil) ⇒ FilterProperty
constructor
A new instance of FilterProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, value:, retain_at_least: nil, unit: nil) ⇒ FilterProperty
Returns a new instance of FilterProperty.
770 771 772 773 774 775 776 777 778 779 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 770 def initialize(type:, value:, retain_at_least: nil, unit: nil) @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") @value = value Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "value") @retain_at_least = retain_at_least Jsii::Type.check_type(@retain_at_least, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retainAtLeast") unless @retain_at_least.nil? @unit = unit Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil? end |
Instance Attribute Details
#retain_at_least ⇒ Numeric? (readonly)
For age-based filters, this is the number of resources to keep on hand after the lifecycle DELETE action is applied.
Impacted resources are only deleted if you have more than this number of resources. If you have fewer resources than this number, the impacted resource is not deleted.
801 802 803 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 801 def retain_at_least @retain_at_least end |
#type ⇒ String (readonly)
Filter resources based on either age or count .
785 786 787 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 785 def type @type end |
#unit ⇒ String? (readonly)
Defines the unit of time that the lifecycle policy uses to determine impacted resources.
This is required for age-based rules.
808 809 810 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 808 def unit @unit end |
#value ⇒ Numeric (readonly)
The number of units for the time period or for the count.
For example, a value of 6 might refer to six months or six AMIs.
For count-based filters, this value represents the minimum number of resources to keep on hand. If you have fewer resources than this number, the resource is excluded from lifecycle actions.
794 795 796 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 794 def value @value end |
Class Method Details
.jsii_properties ⇒ Object
810 811 812 813 814 815 816 817 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 810 def self.jsii_properties { :type => "type", :value => "value", :retain_at_least => "retainAtLeast", :unit => "unit", } end |
Instance Method Details
#to_jsii ⇒ Object
819 820 821 822 823 824 825 826 827 828 |
# File 'image_builder/cfn_lifecycle_policy.rb', line 819 def to_jsii result = {} result.merge!({ "type" => @type, "value" => @value, "retainAtLeast" => @retain_at_least, "unit" => @unit, }) result.compact end |