Class: AWSCDK::DynamoDB::CfnGlobalTable::TimeToLiveSpecificationProperty

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

Overview

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

All replicas will have the same time to live configuration.

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 attribute used to store the expiration time for items in the table.



2024
2025
2026
2027
2028
2029
# File 'dynamo_db/cfn_global_table.rb', line 2024

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 attribute used to store the expiration time for items in the table.

Currently, you cannot directly change the attribute name used to evaluate time to live. In order to do so, you must first disable time to live, and then re-enable it with the new attribute name. It can take up to one hour for changes to time to live to take effect. If you attempt to modify time to live within that time window, your stack operation might be delayed.



2042
2043
2044
# File 'dynamo_db/cfn_global_table.rb', line 2042

def attribute_name
  @attribute_name
end

#enabledBoolean, AWSCDK::IResolvable (readonly)

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



2035
2036
2037
# File 'dynamo_db/cfn_global_table.rb', line 2035

def enabled
  @enabled
end

Class Method Details

.jsii_propertiesObject



2044
2045
2046
2047
2048
2049
# File 'dynamo_db/cfn_global_table.rb', line 2044

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

Instance Method Details

#to_jsiiObject



2051
2052
2053
2054
2055
2056
2057
2058
# File 'dynamo_db/cfn_global_table.rb', line 2051

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