lib/dyna/dsl/table.rb in dyna-0.2.0 vs lib/dyna/dsl/table.rb in dyna-0.2.1.beta1
- old
+ new
@@ -11,10 +11,14 @@
@result = Hashie::Mash.new({
:table_name => table_name,
:scalable_targets => [],
:scaling_policies => [],
+ :time_to_live_specification => {
+ enabled: false,
+ attribute_name: nil,
+ }
})
instance_eval(&block)
end
def key_schema(hash:, range: nil)
@@ -95,9 +99,16 @@
policy_type: 'TargetTrackingScaling',
resource_id: "table/#{@result.table_name}",
scalable_dimension: scalable_dimension,
service_namespace: 'dynamodb',
target_tracking_scaling_policy_configuration: target_tracking_scaling_policy_configuration.merge(predefined_metric_specification: {predefined_metric_type: predefined_metric_type}),
+ }
+ end
+
+ def time_to_live_specification(enabled:, attribute_name:)
+ @result.time_to_live_specification = {
+ enabled: enabled,
+ attribute_name: attribute_name,
}
end
class LocalSecondaryIndex
attr_accessor :result