Class: AWSCDK::ImageBuilder::CfnLifecyclePolicy::FilterProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
image_builder/cfn_lifecycle_policy.rb

Overview

Defines filters that the lifecycle policy uses to determine impacted resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:, retain_at_least: nil, unit: nil) ⇒ FilterProperty

Returns a new instance of FilterProperty.

Parameters:

  • type (String)

    Filter resources based on either age or count .

  • value (Numeric)

    The number of units for the time period or for the count.

  • retain_at_least (Numeric, nil) (defaults to: nil)

    For age-based filters, this is the number of resources to keep on hand after the lifecycle DELETE action is applied.

  • unit (String, nil) (defaults to: nil)

    Defines the unit of time that the lifecycle policy uses to determine impacted resources.



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_leastNumeric? (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

#typeString (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

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

#valueNumeric (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_propertiesObject



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_jsiiObject



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