in lib/aws-record/record/table_migration.rb [158:184]
def _validate_billing(opts)
valid_modes = %w[PAY_PER_REQUEST PROVISIONED]
if opts.key?(:billing_mode)
unless valid_modes.include?(opts[:billing_mode])
raise ArgumentError.new(
":billing_mode option must be one of #{valid_modes.join(', ')}"\
" current value is: #{opts[:billing_mode]}"
)
end
end
if opts.key?(:provisioned_throughput)
if opts[:billing_mode] == 'PAY_PER_REQUEST'
raise ArgumentError.new(
'when :provisioned_throughput option is specified, :billing_mode'\
" must either be unspecified or have a value of 'PROVISIONED'"
)
end
else
if opts[:billing_mode] != 'PAY_PER_REQUEST'
raise ArgumentError.new(
'when :provisioned_throughput option is not specified,'\
" :billing_mode must be set to 'PAY_PER_REQUEST'"
)
end
end
end