Class: AWSCDK::DLM::CfnLifecyclePolicy::DeprecateRuleProperty

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

Overview

[Custom AMI policies only] Specifies an AMI deprecation rule for AMIs created by an AMI lifecycle policy.

For age-based schedules, you must specify Interval and IntervalUnit . For count-based schedules, you must specify Count .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count: nil, interval: nil, interval_unit: nil) ⇒ DeprecateRuleProperty

Returns a new instance of DeprecateRuleProperty.

Parameters:

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

    If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate.

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

    If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule.

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

    The unit of time in which to measure the Interval .



1182
1183
1184
1185
1186
1187
1188
1189
# File 'dlm/cfn_lifecycle_policy.rb', line 1182

def initialize(count: nil, interval: nil, interval_unit: nil)
  @count = count
  Jsii::Type.check_type(@count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "count") unless @count.nil?
  @interval = interval
  Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "interval") unless @interval.nil?
  @interval_unit = interval_unit
  Jsii::Type.check_type(@interval_unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "intervalUnit") unless @interval_unit.nil?
end

Instance Attribute Details

#countNumeric? (readonly)

If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate.

The count must be less than or equal to the schedule's retention count, and it can't be greater than 1000.



1197
1198
1199
# File 'dlm/cfn_lifecycle_policy.rb', line 1197

def count
  @count
end

#intervalNumeric? (readonly)

If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule.

The period must be less than or equal to the schedule's retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.



1204
1205
1206
# File 'dlm/cfn_lifecycle_policy.rb', line 1204

def interval
  @interval
end

#interval_unitString? (readonly)

The unit of time in which to measure the Interval .



1209
1210
1211
# File 'dlm/cfn_lifecycle_policy.rb', line 1209

def interval_unit
  @interval_unit
end

Class Method Details

.jsii_propertiesObject



1211
1212
1213
1214
1215
1216
1217
# File 'dlm/cfn_lifecycle_policy.rb', line 1211

def self.jsii_properties
  {
    :count => "count",
    :interval => "interval",
    :interval_unit => "intervalUnit",
  }
end

Instance Method Details

#to_jsiiObject



1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'dlm/cfn_lifecycle_policy.rb', line 1219

def to_jsii
  result = {}
  result.merge!({
    "count" => @count,
    "interval" => @interval,
    "intervalUnit" => @interval_unit,
  })
  result.compact
end