Class: AWSCDK::ImageBuilder::CfnLifecyclePolicy::LastLaunchedProperty

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

Overview

Defines criteria to exclude AMIs from lifecycle actions based on the last time they were used to launch an instance.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit:, value:) ⇒ LastLaunchedProperty

Returns a new instance of LastLaunchedProperty.

Parameters:

  • unit (String)

    Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI.

  • value (Numeric)

    The integer number of units for the time period.



892
893
894
895
896
897
# File 'image_builder/cfn_lifecycle_policy.rb', line 892

def initialize(unit:, value:)
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit")
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "value")
end

Instance Attribute Details

#unitString (readonly)

Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI.

For example: days, weeks, months, or years.



905
906
907
# File 'image_builder/cfn_lifecycle_policy.rb', line 905

def unit
  @unit
end

#valueNumeric (readonly)

The integer number of units for the time period.

For example 6 (months).



912
913
914
# File 'image_builder/cfn_lifecycle_policy.rb', line 912

def value
  @value
end

Class Method Details

.jsii_propertiesObject



914
915
916
917
918
919
# File 'image_builder/cfn_lifecycle_policy.rb', line 914

def self.jsii_properties
  {
    :unit => "unit",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



921
922
923
924
925
926
927
928
# File 'image_builder/cfn_lifecycle_policy.rb', line 921

def to_jsii
  result = {}
  result.merge!({
    "unit" => @unit,
    "value" => @value,
  })
  result.compact
end