aws-sdk-dynamodb 1.96.0 → 1.132.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +182 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-dynamodb/client.rb +1054 -319
- data/lib/aws-sdk-dynamodb/client_api.rb +218 -34
- data/lib/aws-sdk-dynamodb/endpoint_parameters.rb +27 -6
- data/lib/aws-sdk-dynamodb/endpoint_provider.rb +42 -10
- data/lib/aws-sdk-dynamodb/endpoints.rb +2 -740
- data/lib/aws-sdk-dynamodb/errors.rb +32 -0
- data/lib/aws-sdk-dynamodb/plugins/endpoints.rb +48 -120
- data/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb +26 -0
- data/lib/aws-sdk-dynamodb/resource.rb +66 -27
- data/lib/aws-sdk-dynamodb/table.rb +147 -49
- data/lib/aws-sdk-dynamodb/types.rb +880 -182
- data/lib/aws-sdk-dynamodb.rb +17 -13
- data/sig/client.rbs +1531 -0
- data/sig/errors.rbs +117 -0
- data/sig/resource.rbs +217 -0
- data/sig/table.rbs +378 -0
- data/sig/types.rbs +1847 -0
- data/sig/waiters.rbs +33 -0
- metadata +17 -11
@@ -46,9 +46,11 @@ module Aws::DynamoDB
|
|
46
46
|
# * {ItemCollectionSizeLimitExceededException}
|
47
47
|
# * {LimitExceededException}
|
48
48
|
# * {PointInTimeRecoveryUnavailableException}
|
49
|
+
# * {PolicyNotFoundException}
|
49
50
|
# * {ProvisionedThroughputExceededException}
|
50
51
|
# * {ReplicaAlreadyExistsException}
|
51
52
|
# * {ReplicaNotFoundException}
|
53
|
+
# * {ReplicatedWriteConflictException}
|
52
54
|
# * {RequestLimitExceeded}
|
53
55
|
# * {ResourceInUseException}
|
54
56
|
# * {ResourceNotFoundException}
|
@@ -355,6 +357,21 @@ module Aws::DynamoDB
|
|
355
357
|
end
|
356
358
|
end
|
357
359
|
|
360
|
+
class PolicyNotFoundException < ServiceError
|
361
|
+
|
362
|
+
# @param [Seahorse::Client::RequestContext] context
|
363
|
+
# @param [String] message
|
364
|
+
# @param [Aws::DynamoDB::Types::PolicyNotFoundException] data
|
365
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
366
|
+
super(context, message, data)
|
367
|
+
end
|
368
|
+
|
369
|
+
# @return [String]
|
370
|
+
def message
|
371
|
+
@message || @data[:message]
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
358
375
|
class ProvisionedThroughputExceededException < ServiceError
|
359
376
|
|
360
377
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -400,6 +417,21 @@ module Aws::DynamoDB
|
|
400
417
|
end
|
401
418
|
end
|
402
419
|
|
420
|
+
class ReplicatedWriteConflictException < ServiceError
|
421
|
+
|
422
|
+
# @param [Seahorse::Client::RequestContext] context
|
423
|
+
# @param [String] message
|
424
|
+
# @param [Aws::DynamoDB::Types::ReplicatedWriteConflictException] data
|
425
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
426
|
+
super(context, message, data)
|
427
|
+
end
|
428
|
+
|
429
|
+
# @return [String]
|
430
|
+
def message
|
431
|
+
@message || @data[:message]
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
403
435
|
class RequestLimitExceeded < ServiceError
|
404
436
|
|
405
437
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -14,35 +14,74 @@ module Aws::DynamoDB
|
|
14
14
|
option(
|
15
15
|
:endpoint_provider,
|
16
16
|
doc_type: 'Aws::DynamoDB::EndpointProvider',
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
rbs_type: 'untyped',
|
18
|
+
docstring: <<~DOCS) do |_cfg|
|
19
|
+
The endpoint provider used to resolve endpoints. Any object that responds to
|
20
|
+
`#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
|
21
|
+
`Aws::DynamoDB::EndpointParameters`.
|
22
|
+
DOCS
|
22
23
|
Aws::DynamoDB::EndpointProvider.new
|
23
24
|
end
|
24
25
|
|
26
|
+
option(
|
27
|
+
:account_id_endpoint_mode,
|
28
|
+
doc_type: 'String',
|
29
|
+
docstring: <<~DOCS) do |cfg|
|
30
|
+
The account ID endpoint mode to use. This can be one of the following values:
|
31
|
+
* `preferred` - The default behavior. Use the account ID endpoint if
|
32
|
+
available, otherwise use the standard endpoint.
|
33
|
+
* `disabled` - Never use the account ID endpoint. Only use the standard
|
34
|
+
endpoint.
|
35
|
+
* `required` - Always use the account ID endpoint. If the account ID
|
36
|
+
cannot be retrieved from credentials, an error is raised.
|
37
|
+
DOCS
|
38
|
+
value = ENV['AWS_ACCOUNT_ID_ENDPOINT_MODE']
|
39
|
+
value ||= Aws.shared_config.account_id_endpoint_mode(profile: cfg.profile)
|
40
|
+
value || 'preferred'
|
41
|
+
end
|
42
|
+
|
25
43
|
# @api private
|
26
44
|
class Handler < Seahorse::Client::Handler
|
27
45
|
def call(context)
|
28
|
-
# If endpoint was discovered, do not resolve or apply the endpoint.
|
29
46
|
unless context[:discovered_endpoint]
|
30
|
-
params = parameters_for_operation(context)
|
47
|
+
params = Aws::DynamoDB::Endpoints.parameters_for_operation(context)
|
31
48
|
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
32
49
|
|
33
50
|
context.http_request.endpoint = endpoint.url
|
34
51
|
apply_endpoint_headers(context, endpoint.headers)
|
52
|
+
|
53
|
+
context[:endpoint_params] = params
|
54
|
+
context[:endpoint_properties] = endpoint.properties
|
35
55
|
end
|
36
56
|
|
37
|
-
context[:endpoint_params] = params
|
38
57
|
context[:auth_scheme] =
|
39
58
|
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
40
59
|
|
41
|
-
@handler.call(context)
|
60
|
+
with_metrics(context) { @handler.call(context) }
|
42
61
|
end
|
43
62
|
|
44
63
|
private
|
45
64
|
|
65
|
+
def with_metrics(context, &block)
|
66
|
+
metrics = []
|
67
|
+
metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
|
68
|
+
if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
|
69
|
+
metrics << 'SIGV4A_SIGNING'
|
70
|
+
end
|
71
|
+
case context.config.account_id_endpoint_mode
|
72
|
+
when 'preferred'
|
73
|
+
metrics << 'ACCOUNT_ID_MODE_PREFERRED'
|
74
|
+
when 'disabled'
|
75
|
+
metrics << 'ACCOUNT_ID_MODE_DISABLED'
|
76
|
+
when 'required'
|
77
|
+
metrics << 'ACCOUNT_ID_MODE_REQUIRED'
|
78
|
+
end
|
79
|
+
if context.config.credentials&.credentials&.account_id
|
80
|
+
metrics << 'RESOLVED_ACCOUNT_ID'
|
81
|
+
end
|
82
|
+
Aws::Plugins::UserAgent.metric(*metrics, &block)
|
83
|
+
end
|
84
|
+
|
46
85
|
def apply_endpoint_headers(context, headers)
|
47
86
|
headers.each do |key, values|
|
48
87
|
value = values
|
@@ -53,117 +92,6 @@ module Aws::DynamoDB
|
|
53
92
|
context.http_request.headers[key] = value
|
54
93
|
end
|
55
94
|
end
|
56
|
-
|
57
|
-
def parameters_for_operation(context)
|
58
|
-
case context.operation_name
|
59
|
-
when :batch_execute_statement
|
60
|
-
Aws::DynamoDB::Endpoints::BatchExecuteStatement.build(context)
|
61
|
-
when :batch_get_item
|
62
|
-
Aws::DynamoDB::Endpoints::BatchGetItem.build(context)
|
63
|
-
when :batch_write_item
|
64
|
-
Aws::DynamoDB::Endpoints::BatchWriteItem.build(context)
|
65
|
-
when :create_backup
|
66
|
-
Aws::DynamoDB::Endpoints::CreateBackup.build(context)
|
67
|
-
when :create_global_table
|
68
|
-
Aws::DynamoDB::Endpoints::CreateGlobalTable.build(context)
|
69
|
-
when :create_table
|
70
|
-
Aws::DynamoDB::Endpoints::CreateTable.build(context)
|
71
|
-
when :delete_backup
|
72
|
-
Aws::DynamoDB::Endpoints::DeleteBackup.build(context)
|
73
|
-
when :delete_item
|
74
|
-
Aws::DynamoDB::Endpoints::DeleteItem.build(context)
|
75
|
-
when :delete_table
|
76
|
-
Aws::DynamoDB::Endpoints::DeleteTable.build(context)
|
77
|
-
when :describe_backup
|
78
|
-
Aws::DynamoDB::Endpoints::DescribeBackup.build(context)
|
79
|
-
when :describe_continuous_backups
|
80
|
-
Aws::DynamoDB::Endpoints::DescribeContinuousBackups.build(context)
|
81
|
-
when :describe_contributor_insights
|
82
|
-
Aws::DynamoDB::Endpoints::DescribeContributorInsights.build(context)
|
83
|
-
when :describe_endpoints
|
84
|
-
Aws::DynamoDB::Endpoints::DescribeEndpoints.build(context)
|
85
|
-
when :describe_export
|
86
|
-
Aws::DynamoDB::Endpoints::DescribeExport.build(context)
|
87
|
-
when :describe_global_table
|
88
|
-
Aws::DynamoDB::Endpoints::DescribeGlobalTable.build(context)
|
89
|
-
when :describe_global_table_settings
|
90
|
-
Aws::DynamoDB::Endpoints::DescribeGlobalTableSettings.build(context)
|
91
|
-
when :describe_import
|
92
|
-
Aws::DynamoDB::Endpoints::DescribeImport.build(context)
|
93
|
-
when :describe_kinesis_streaming_destination
|
94
|
-
Aws::DynamoDB::Endpoints::DescribeKinesisStreamingDestination.build(context)
|
95
|
-
when :describe_limits
|
96
|
-
Aws::DynamoDB::Endpoints::DescribeLimits.build(context)
|
97
|
-
when :describe_table
|
98
|
-
Aws::DynamoDB::Endpoints::DescribeTable.build(context)
|
99
|
-
when :describe_table_replica_auto_scaling
|
100
|
-
Aws::DynamoDB::Endpoints::DescribeTableReplicaAutoScaling.build(context)
|
101
|
-
when :describe_time_to_live
|
102
|
-
Aws::DynamoDB::Endpoints::DescribeTimeToLive.build(context)
|
103
|
-
when :disable_kinesis_streaming_destination
|
104
|
-
Aws::DynamoDB::Endpoints::DisableKinesisStreamingDestination.build(context)
|
105
|
-
when :enable_kinesis_streaming_destination
|
106
|
-
Aws::DynamoDB::Endpoints::EnableKinesisStreamingDestination.build(context)
|
107
|
-
when :execute_statement
|
108
|
-
Aws::DynamoDB::Endpoints::ExecuteStatement.build(context)
|
109
|
-
when :execute_transaction
|
110
|
-
Aws::DynamoDB::Endpoints::ExecuteTransaction.build(context)
|
111
|
-
when :export_table_to_point_in_time
|
112
|
-
Aws::DynamoDB::Endpoints::ExportTableToPointInTime.build(context)
|
113
|
-
when :get_item
|
114
|
-
Aws::DynamoDB::Endpoints::GetItem.build(context)
|
115
|
-
when :import_table
|
116
|
-
Aws::DynamoDB::Endpoints::ImportTable.build(context)
|
117
|
-
when :list_backups
|
118
|
-
Aws::DynamoDB::Endpoints::ListBackups.build(context)
|
119
|
-
when :list_contributor_insights
|
120
|
-
Aws::DynamoDB::Endpoints::ListContributorInsights.build(context)
|
121
|
-
when :list_exports
|
122
|
-
Aws::DynamoDB::Endpoints::ListExports.build(context)
|
123
|
-
when :list_global_tables
|
124
|
-
Aws::DynamoDB::Endpoints::ListGlobalTables.build(context)
|
125
|
-
when :list_imports
|
126
|
-
Aws::DynamoDB::Endpoints::ListImports.build(context)
|
127
|
-
when :list_tables
|
128
|
-
Aws::DynamoDB::Endpoints::ListTables.build(context)
|
129
|
-
when :list_tags_of_resource
|
130
|
-
Aws::DynamoDB::Endpoints::ListTagsOfResource.build(context)
|
131
|
-
when :put_item
|
132
|
-
Aws::DynamoDB::Endpoints::PutItem.build(context)
|
133
|
-
when :query
|
134
|
-
Aws::DynamoDB::Endpoints::Query.build(context)
|
135
|
-
when :restore_table_from_backup
|
136
|
-
Aws::DynamoDB::Endpoints::RestoreTableFromBackup.build(context)
|
137
|
-
when :restore_table_to_point_in_time
|
138
|
-
Aws::DynamoDB::Endpoints::RestoreTableToPointInTime.build(context)
|
139
|
-
when :scan
|
140
|
-
Aws::DynamoDB::Endpoints::Scan.build(context)
|
141
|
-
when :tag_resource
|
142
|
-
Aws::DynamoDB::Endpoints::TagResource.build(context)
|
143
|
-
when :transact_get_items
|
144
|
-
Aws::DynamoDB::Endpoints::TransactGetItems.build(context)
|
145
|
-
when :transact_write_items
|
146
|
-
Aws::DynamoDB::Endpoints::TransactWriteItems.build(context)
|
147
|
-
when :untag_resource
|
148
|
-
Aws::DynamoDB::Endpoints::UntagResource.build(context)
|
149
|
-
when :update_continuous_backups
|
150
|
-
Aws::DynamoDB::Endpoints::UpdateContinuousBackups.build(context)
|
151
|
-
when :update_contributor_insights
|
152
|
-
Aws::DynamoDB::Endpoints::UpdateContributorInsights.build(context)
|
153
|
-
when :update_global_table
|
154
|
-
Aws::DynamoDB::Endpoints::UpdateGlobalTable.build(context)
|
155
|
-
when :update_global_table_settings
|
156
|
-
Aws::DynamoDB::Endpoints::UpdateGlobalTableSettings.build(context)
|
157
|
-
when :update_item
|
158
|
-
Aws::DynamoDB::Endpoints::UpdateItem.build(context)
|
159
|
-
when :update_table
|
160
|
-
Aws::DynamoDB::Endpoints::UpdateTable.build(context)
|
161
|
-
when :update_table_replica_auto_scaling
|
162
|
-
Aws::DynamoDB::Endpoints::UpdateTableReplicaAutoScaling.build(context)
|
163
|
-
when :update_time_to_live
|
164
|
-
Aws::DynamoDB::Endpoints::UpdateTimeToLive.build(context)
|
165
|
-
end
|
166
|
-
end
|
167
95
|
end
|
168
96
|
|
169
97
|
def add_handlers(handlers, _config)
|
@@ -13,6 +13,30 @@ module Aws
|
|
13
13
|
#
|
14
14
|
# ddb = Aws::DynamoDB::Client.new(simple_attributes: false)
|
15
15
|
#
|
16
|
+
# Members are marshalled using the following objects:
|
17
|
+
#
|
18
|
+
# * `Hash` or `#to_h` => `:m`
|
19
|
+
# * `Array` => `:l`
|
20
|
+
# * `String` or `Symbol` or `#to_str` => `:s`
|
21
|
+
# * `Numeric` => `:n`
|
22
|
+
# * `StringIO` or `IO` => `:b`
|
23
|
+
# * `Set<Object>` => `:ss` or `:ns` or `:bs`
|
24
|
+
# * `true` or `false` => `:bool`
|
25
|
+
# * `nil` => `:null`
|
26
|
+
#
|
27
|
+
# Members are unmarshalled into the following objects:
|
28
|
+
#
|
29
|
+
# * `:m` => `Hash`
|
30
|
+
# * `:l` => `Array`
|
31
|
+
# * `:s` => `String`
|
32
|
+
# * `:n` => `BigDecimal`
|
33
|
+
# * `:b` => `StringIO`
|
34
|
+
# * `:null` => `nil`
|
35
|
+
# * `:bool` => `true` or `false`
|
36
|
+
# * `:ss` => `Set<String>`
|
37
|
+
# * `:ns` => `Set<BigDecimal>`
|
38
|
+
# * `:bs` => `Set<StringIO>`
|
39
|
+
#
|
16
40
|
# ## Input Examples
|
17
41
|
#
|
18
42
|
# With this plugin **enabled**, `simple_attributes: true`:
|
@@ -101,6 +125,8 @@ hashes, arrays, sets, integers, floats, booleans, and nil.
|
|
101
125
|
Disabling this option requires that all attribute values have
|
102
126
|
their types specified, e.g. `{ s: 'abc' }` instead of simply
|
103
127
|
`'abc'`.
|
128
|
+
|
129
|
+
See {Aws::DynamoDB::Plugins::SimpleAttributes} for more information.
|
104
130
|
DOCS
|
105
131
|
) do |config|
|
106
132
|
!config.simple_json
|
@@ -39,7 +39,7 @@ module Aws::DynamoDB
|
|
39
39
|
#
|
40
40
|
# dynamo_db.batch_get_item({
|
41
41
|
# request_items: { # required
|
42
|
-
# "
|
42
|
+
# "TableArn" => {
|
43
43
|
# keys: [ # required
|
44
44
|
# {
|
45
45
|
# "AttributeName" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
|
@@ -57,9 +57,9 @@ module Aws::DynamoDB
|
|
57
57
|
# })
|
58
58
|
# @param [Hash] options ({})
|
59
59
|
# @option options [required, Hash<String,Types::KeysAndAttributes>] :request_items
|
60
|
-
# A map of one or more table names and, for each table, a
|
61
|
-
# describes one or more items to retrieve from that table. Each
|
62
|
-
# name can be used only once per `BatchGetItem` request.
|
60
|
+
# A map of one or more table names or table ARNs and, for each table, a
|
61
|
+
# map that describes one or more items to retrieve from that table. Each
|
62
|
+
# table name or ARN can be used only once per `BatchGetItem` request.
|
63
63
|
#
|
64
64
|
# Each element in the map of items to retrieve consists of the
|
65
65
|
# following:
|
@@ -79,31 +79,27 @@ module Aws::DynamoDB
|
|
79
79
|
#
|
80
80
|
# * To prevent special characters in an attribute name from being
|
81
81
|
# misinterpreted in an expression.
|
82
|
-
#
|
83
82
|
# Use the **#** character in an expression to dereference an attribute
|
84
83
|
# name. For example, consider the following attribute name:
|
85
84
|
#
|
86
85
|
# * `Percentile`
|
87
86
|
#
|
88
87
|
# ^
|
89
|
-
#
|
90
88
|
# The name of this attribute conflicts with a reserved word, so it
|
91
89
|
# cannot be used directly in an expression. (For the complete list of
|
92
90
|
# reserved words, see [Reserved Words][1] in the *Amazon DynamoDB
|
93
91
|
# Developer Guide*). To work around this, you could specify the
|
94
92
|
# following for `ExpressionAttributeNames`:
|
95
93
|
#
|
96
|
-
# *
|
94
|
+
# * `{"#P":"Percentile"}`
|
97
95
|
#
|
98
96
|
# ^
|
99
|
-
#
|
100
97
|
# You could then use this substitution in an expression, as in this
|
101
98
|
# example:
|
102
99
|
#
|
103
100
|
# * `#P = :val`
|
104
101
|
#
|
105
102
|
# ^
|
106
|
-
#
|
107
103
|
# <note markdown="1"> Tokens that begin with the **\:** character are *expression
|
108
104
|
# attribute values*, which are placeholders for the actual value at
|
109
105
|
# runtime.
|
@@ -160,7 +156,7 @@ module Aws::DynamoDB
|
|
160
156
|
# * `NONE` - No `ConsumedCapacity` details are included in the response.
|
161
157
|
# @return [Types::BatchGetItemOutput]
|
162
158
|
def batch_get_item(options = {})
|
163
|
-
resp = Aws::Plugins::UserAgent.
|
159
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
164
160
|
@client.batch_get_item(options)
|
165
161
|
end
|
166
162
|
resp.data
|
@@ -170,7 +166,7 @@ module Aws::DynamoDB
|
|
170
166
|
#
|
171
167
|
# dynamo_db.batch_write_item({
|
172
168
|
# request_items: { # required
|
173
|
-
# "
|
169
|
+
# "TableArn" => [
|
174
170
|
# {
|
175
171
|
# put_request: {
|
176
172
|
# item: { # required
|
@@ -190,9 +186,9 @@ module Aws::DynamoDB
|
|
190
186
|
# })
|
191
187
|
# @param [Hash] options ({})
|
192
188
|
# @option options [required, Hash<String,Array>] :request_items
|
193
|
-
# A map of one or more table names and, for each table, a
|
194
|
-
# operations to be performed (`DeleteRequest` or `PutRequest`).
|
195
|
-
# element in the map consists of the following:
|
189
|
+
# A map of one or more table names or table ARNs and, for each table, a
|
190
|
+
# list of operations to be performed (`DeleteRequest` or `PutRequest`).
|
191
|
+
# Each element in the map consists of the following:
|
196
192
|
#
|
197
193
|
# * `DeleteRequest` - Perform a `DeleteItem` operation on the specified
|
198
194
|
# item. The item to be deleted is identified by a `Key` subelement:
|
@@ -206,7 +202,6 @@ module Aws::DynamoDB
|
|
206
202
|
# *both* the partition key and the sort key.
|
207
203
|
#
|
208
204
|
# ^
|
209
|
-
#
|
210
205
|
# * `PutRequest` - Perform a `PutItem` operation on the specified item.
|
211
206
|
# The item to be put is identified by an `Item` subelement:
|
212
207
|
#
|
@@ -243,7 +238,7 @@ module Aws::DynamoDB
|
|
243
238
|
# response. If set to `NONE` (the default), no statistics are returned.
|
244
239
|
# @return [Types::BatchWriteItemOutput]
|
245
240
|
def batch_write_item(options = {})
|
246
|
-
resp = Aws::Plugins::UserAgent.
|
241
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
247
242
|
@client.batch_write_item(options)
|
248
243
|
end
|
249
244
|
resp.data
|
@@ -258,7 +253,7 @@ module Aws::DynamoDB
|
|
258
253
|
# attribute_type: "S", # required, accepts S, N, B
|
259
254
|
# },
|
260
255
|
# ],
|
261
|
-
# table_name: "
|
256
|
+
# table_name: "TableArn", # required
|
262
257
|
# key_schema: [ # required
|
263
258
|
# {
|
264
259
|
# attribute_name: "KeySchemaAttributeName", # required
|
@@ -297,6 +292,14 @@ module Aws::DynamoDB
|
|
297
292
|
# read_capacity_units: 1, # required
|
298
293
|
# write_capacity_units: 1, # required
|
299
294
|
# },
|
295
|
+
# on_demand_throughput: {
|
296
|
+
# max_read_request_units: 1,
|
297
|
+
# max_write_request_units: 1,
|
298
|
+
# },
|
299
|
+
# warm_throughput: {
|
300
|
+
# read_units_per_second: 1,
|
301
|
+
# write_units_per_second: 1,
|
302
|
+
# },
|
300
303
|
# },
|
301
304
|
# ],
|
302
305
|
# billing_mode: "PROVISIONED", # accepts PROVISIONED, PAY_PER_REQUEST
|
@@ -321,13 +324,23 @@ module Aws::DynamoDB
|
|
321
324
|
# ],
|
322
325
|
# table_class: "STANDARD", # accepts STANDARD, STANDARD_INFREQUENT_ACCESS
|
323
326
|
# deletion_protection_enabled: false,
|
327
|
+
# warm_throughput: {
|
328
|
+
# read_units_per_second: 1,
|
329
|
+
# write_units_per_second: 1,
|
330
|
+
# },
|
331
|
+
# resource_policy: "ResourcePolicy",
|
332
|
+
# on_demand_throughput: {
|
333
|
+
# max_read_request_units: 1,
|
334
|
+
# max_write_request_units: 1,
|
335
|
+
# },
|
324
336
|
# })
|
325
337
|
# @param [Hash] options ({})
|
326
338
|
# @option options [required, Array<Types::AttributeDefinition>] :attribute_definitions
|
327
339
|
# An array of attributes that describe the key schema for the table and
|
328
340
|
# indexes.
|
329
341
|
# @option options [required, String] :table_name
|
330
|
-
# The name of the table to create.
|
342
|
+
# The name of the table to create. You can also provide the Amazon
|
343
|
+
# Resource Name (ARN) of the table in this parameter.
|
331
344
|
# @option options [required, Array<Types::KeySchemaElement>] :key_schema
|
332
345
|
# Specifies the attributes that make up the primary key for a table or
|
333
346
|
# an index. The attributes in `KeySchema` must also be defined in the
|
@@ -404,7 +417,6 @@ module Aws::DynamoDB
|
|
404
417
|
#
|
405
418
|
# * `ALL` - All of the table attributes are projected into the
|
406
419
|
# index.
|
407
|
-
#
|
408
420
|
# * `NonKeyAttributes` - A list of one or more non-key attribute names
|
409
421
|
# that are projected into the secondary index. The total count of
|
410
422
|
# attributes provided in `NonKeyAttributes`, summed across all of
|
@@ -440,14 +452,12 @@ module Aws::DynamoDB
|
|
440
452
|
#
|
441
453
|
# * `ALL` - All of the table attributes are projected into the
|
442
454
|
# index.
|
443
|
-
#
|
444
455
|
# * `NonKeyAttributes` - A list of one or more non-key attribute names
|
445
456
|
# that are projected into the secondary index. The total count of
|
446
457
|
# attributes provided in `NonKeyAttributes`, summed across all of
|
447
458
|
# the secondary indexes, must not exceed 100. If you project the
|
448
459
|
# same attribute into two different indexes, this counts as two
|
449
460
|
# distinct attributes when determining the total.
|
450
|
-
#
|
451
461
|
# * `ProvisionedThroughput` - The provisioned throughput settings for
|
452
462
|
# the global secondary index, consisting of read and write capacity
|
453
463
|
# units.
|
@@ -457,16 +467,16 @@ module Aws::DynamoDB
|
|
457
467
|
#
|
458
468
|
# * `PROVISIONED` - We recommend using `PROVISIONED` for predictable
|
459
469
|
# workloads. `PROVISIONED` sets the billing mode to [Provisioned
|
460
|
-
#
|
470
|
+
# capacity mode][1].
|
461
471
|
#
|
462
472
|
# * `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for
|
463
473
|
# unpredictable workloads. `PAY_PER_REQUEST` sets the billing mode to
|
464
|
-
# [On-
|
474
|
+
# [On-demand capacity mode][2].
|
465
475
|
#
|
466
476
|
#
|
467
477
|
#
|
468
|
-
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
469
|
-
# [2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
478
|
+
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html
|
479
|
+
# [2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html
|
470
480
|
# @option options [Types::ProvisionedThroughput] :provisioned_throughput
|
471
481
|
# Represents the provisioned throughput settings for a specified table
|
472
482
|
# or index. The settings can be modified using the `UpdateTable`
|
@@ -520,9 +530,38 @@ module Aws::DynamoDB
|
|
520
530
|
# @option options [Boolean] :deletion_protection_enabled
|
521
531
|
# Indicates whether deletion protection is to be enabled (true) or
|
522
532
|
# disabled (false) on the table.
|
533
|
+
# @option options [Types::WarmThroughput] :warm_throughput
|
534
|
+
# Represents the warm throughput (in read units per second and write
|
535
|
+
# units per second) for creating a table.
|
536
|
+
# @option options [String] :resource_policy
|
537
|
+
# An Amazon Web Services resource-based policy document in JSON format
|
538
|
+
# that will be attached to the table.
|
539
|
+
#
|
540
|
+
# When you attach a resource-based policy while creating a table, the
|
541
|
+
# policy application is *strongly consistent*.
|
542
|
+
#
|
543
|
+
# The maximum size supported for a resource-based policy document is 20
|
544
|
+
# KB. DynamoDB counts whitespaces when calculating the size of a policy
|
545
|
+
# against this limit. For a full list of all considerations that apply
|
546
|
+
# for resource-based policies, see [Resource-based policy
|
547
|
+
# considerations][1].
|
548
|
+
#
|
549
|
+
# <note markdown="1"> You need to specify the `CreateTable` and `PutResourcePolicy` IAM
|
550
|
+
# actions for authorizing a user to create a table with a resource-based
|
551
|
+
# policy.
|
552
|
+
#
|
553
|
+
# </note>
|
554
|
+
#
|
555
|
+
#
|
556
|
+
#
|
557
|
+
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html
|
558
|
+
# @option options [Types::OnDemandThroughput] :on_demand_throughput
|
559
|
+
# Sets the maximum number of read and write units for the specified
|
560
|
+
# table in on-demand capacity mode. If you use this parameter, you must
|
561
|
+
# specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
|
523
562
|
# @return [Table]
|
524
563
|
def create_table(options = {})
|
525
|
-
resp = Aws::Plugins::UserAgent.
|
564
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
526
565
|
@client.create_table(options)
|
527
566
|
end
|
528
567
|
Table.new(
|
@@ -550,7 +589,7 @@ module Aws::DynamoDB
|
|
550
589
|
# @return [Table::Collection]
|
551
590
|
def tables(options = {})
|
552
591
|
batches = Enumerator.new do |y|
|
553
|
-
resp = Aws::Plugins::UserAgent.
|
592
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
554
593
|
@client.list_tables(options)
|
555
594
|
end
|
556
595
|
resp.each_page do |page|
|