aws::dynamodb-table¶
Creates a DynamoDb table.
Example¶
aws::dynamodb-table dynamodb-table-example
name: "dynamodb-table-example"
hash-key: "HashKeyName"
range-key: "RangeKeyName"
billing-mode: "PROVISIONED"
read-capacity: 5
write-capacity: 5
stream-enabled: true
stream-view-type: "KEYS_ONLY"
attribute
name: "HashKeyName"
type: "S"
end
attribute
name: "RangeKeyName"
type: "S"
end
attribute
name: "GlobalRangeKeyName"
type: "S"
end
attribute
name: "LocalRangeKeyName"
type: "S"
end
global-secondary-index
name: "global-secondary-index"
hash-key: "RangeKeyName"
range-key: "GlobalRangeKeyName"
write-capacity: 20
read-capacity: 20
projection-type: "INCLUDE"
non-key-attributes: ["HashKeyName"]
end
local-secondary-index
name: "local-secondary-index"
range-key: "LocalRangeKeyName"
projection-type: "ALL"
end
server-side-encryption
enabled: true
end
tags: {
Name: "dynamodb-table-example"
}
end
Attributes¶
| Attribute | Description |
|---|---|
| attribute set subresource | Set of attribute definitions that describe the key schema. (Required)
|
| hash-key | The name of the hash (partition) key for this index. Must be defined as an attribute. (Required) |
| range-key | The name of the range (sort) key for this index. Must be defined as an attribute. |
| name | The name of the DynamoDb table. Valid values satisfy the regex: [[a-zA-Z0-9_.-]+]. (Required) |
| billing-mode | Controls how you are charged for read and write throughput and how you manage capacity. Defaults to PROVISIONED. Valid values are PROVISIONED or PAY_PER_REQUEST. |
| global-secondary-index set subresource | One or more global secondary indexes to be created on the table.
|
| local-secondary-index set subresource | One or more local secondary indexes to be created on the table. LSIs automatically use the same hash key of the table itself.
|
| write-capacity | The maximum number of writes per second for this table before an exception is thrown. Required if billing-mode is set to PROVISIONED. Minimum allowed value is 1. |
| read-capacity | The maximum number of reads per second for this table before an exception is thrown. Required if billing-mode is set to PROVISIONED. Minimum allowed value is 1. |
| server-side-encryption subresource | Settings used to determine server side encryption.
|
| stream-enabled | Indicates whether streams should be enabled. |
| stream-view-type | Determines what information is written to the stream when an item is modified. Valid values are NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES or KEYS_ONLY. |
| tags map | The tags for the DynamoDb table. |
Outputs¶
| Attribute | Description |
|---|---|
| arn | The ARN of the DynamoDb table. |
| stream-arn | The ARN of the table stream. |
| stream-label | A timestamp, in ISO 8601 format, for the table stream. |