Class: AWSCDK::DynamoDB::CfnTable::TimeToLiveSpecificationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dynamo_db/cfn_table.rb

Overview

Represents the settings used to enable or disable Time to Live (TTL) for the specified table.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled:, attribute_name: nil) ⇒ TimeToLiveSpecificationProperty

Returns a new instance of TimeToLiveSpecificationProperty.

Parameters:

  • enabled (Boolean, AWSCDK::IResolvable)

    Indicates whether TTL is to be enabled (true) or disabled (false) on the table.

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

    The name of the TTL attribute used to store the expiration time for items in the table.



1755
1756
1757
1758
1759
1760
# File 'dynamo_db/cfn_table.rb', line 1755

def initialize(enabled:, attribute_name: nil)
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled")
  @attribute_name = attribute_name
  Jsii::Type.check_type(@attribute_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeName") unless @attribute_name.nil?
end

Instance Attribute Details

#attribute_nameString? (readonly)

The name of the TTL attribute used to store the expiration time for items in the table.

  • The AttributeName property is required when enabling the TTL, or when TTL is already enabled.
  • To update this property, you must first disable TTL and then enable TTL with the new attribute name.


1774
1775
1776
# File 'dynamo_db/cfn_table.rb', line 1774

def attribute_name
  @attribute_name
end

#enabledBoolean, AWSCDK::IResolvable (readonly)

Indicates whether TTL is to be enabled (true) or disabled (false) on the table.



1766
1767
1768
# File 'dynamo_db/cfn_table.rb', line 1766

def enabled
  @enabled
end

Class Method Details

.jsii_propertiesObject



1776
1777
1778
1779
1780
1781
# File 'dynamo_db/cfn_table.rb', line 1776

def self.jsii_properties
  {
    :enabled => "enabled",
    :attribute_name => "attributeName",
  }
end

Instance Method Details

#to_jsiiObject



1783
1784
1785
1786
1787
1788
1789
1790
# File 'dynamo_db/cfn_table.rb', line 1783

def to_jsii
  result = {}
  result.merge!({
    "enabled" => @enabled,
    "attributeName" => @attribute_name,
  })
  result.compact
end