in lib/aws-record/record/table_config.rb [345:368]
def _create_table_opts
opts = {
table_name: @model_class.table_name
}
if @billing_mode == "PROVISIONED"
opts[:provisioned_throughput] = {
read_capacity_units: @read_capacity_units,
write_capacity_units: @write_capacity_units
}
elsif @billing_mode == "PAY_PER_REQUEST"
opts[:billing_mode] = @billing_mode
else
raise ArgumentError, "Unsupported billing mode #{@billing_mode}"
end
opts[:key_schema] = _key_schema
opts[:attribute_definitions] = _attribute_definitions
gsi = _global_secondary_indexes
unless gsi.empty?
opts[:global_secondary_indexes] = gsi
end
opts
end