mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #2576 from johnewart/dynamodb_docs
[dynamodb] Update docs and fix the acceptance test accordingly
This commit is contained in:
commit
0d58b94636
@ -279,10 +279,6 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" {
|
|||||||
name = "ReplacementGSIRangeKey"
|
name = "ReplacementGSIRangeKey"
|
||||||
type = "N"
|
type = "N"
|
||||||
}
|
}
|
||||||
attribute {
|
|
||||||
name = "TestNonKeyAttribute"
|
|
||||||
type = "S"
|
|
||||||
}
|
|
||||||
local_secondary_index {
|
local_secondary_index {
|
||||||
name = "TestTableLSI"
|
name = "TestTableLSI"
|
||||||
range_key = "TestLSIRangeKey"
|
range_key = "TestLSIRangeKey"
|
||||||
|
@ -23,7 +23,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" {
|
|||||||
hash_key = "UserId"
|
hash_key = "UserId"
|
||||||
range_key = "GameTitle"
|
range_key = "GameTitle"
|
||||||
attribute {
|
attribute {
|
||||||
name = "Username"
|
name = "UserId"
|
||||||
type = "S"
|
type = "S"
|
||||||
}
|
}
|
||||||
attribute {
|
attribute {
|
||||||
@ -34,18 +34,6 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" {
|
|||||||
name = "TopScore"
|
name = "TopScore"
|
||||||
type = "N"
|
type = "N"
|
||||||
}
|
}
|
||||||
attribute {
|
|
||||||
name = "TopScoreDateTime"
|
|
||||||
type = "S"
|
|
||||||
}
|
|
||||||
attribute {
|
|
||||||
name = "Wins"
|
|
||||||
type = "N"
|
|
||||||
}
|
|
||||||
attribute {
|
|
||||||
name = "Losses"
|
|
||||||
type = "N"
|
|
||||||
}
|
|
||||||
global_secondary_index {
|
global_secondary_index {
|
||||||
name = "GameTitleIndex"
|
name = "GameTitleIndex"
|
||||||
hash_key = "GameTitle"
|
hash_key = "GameTitle"
|
||||||
@ -93,14 +81,30 @@ the following properties are supported:
|
|||||||
projects only the keys specified in the _non_key_attributes_
|
projects only the keys specified in the _non_key_attributes_
|
||||||
parameter.
|
parameter.
|
||||||
* `non_key_attributes` - (Optional) Only required with *INCLUDE* as a
|
* `non_key_attributes` - (Optional) Only required with *INCLUDE* as a
|
||||||
projection type; a list of attributes to project into the index. For
|
projection type; a list of attributes to project into the index. These
|
||||||
each attribute listed, you need to make sure that it has been defined in
|
do not need to be defined as attributes on the table.
|
||||||
the table object.
|
|
||||||
|
|
||||||
For `global_secondary_index` objects only, you need to specify
|
For `global_secondary_index` objects only, you need to specify
|
||||||
`write_capacity` and `read_capacity` in the same way you would for the
|
`write_capacity` and `read_capacity` in the same way you would for the
|
||||||
table as they have separate I/O capacity.
|
table as they have separate I/O capacity.
|
||||||
|
|
||||||
|
### A note about attributes
|
||||||
|
|
||||||
|
Only define attributes on the table object that are going to be used as:
|
||||||
|
|
||||||
|
* Table hash key or range key
|
||||||
|
* LSI or GSI hash key or range key
|
||||||
|
|
||||||
|
The DynamoDB API expects attribute structure (name and type) to be
|
||||||
|
passed along when creating or updating GSI/LSIs or creating the initial
|
||||||
|
table. In these cases it expects the Hash / Range keys to be provided;
|
||||||
|
because these get re-used in numerous places (i.e the table's range key
|
||||||
|
could be a part of one or more GSIs), they are stored on the table
|
||||||
|
object to prevent duplication and increase consistency. If you add
|
||||||
|
attributes here that are not used in these scenarios it can cause an
|
||||||
|
infinite loop in planning.
|
||||||
|
|
||||||
|
|
||||||
## Attributes Reference
|
## Attributes Reference
|
||||||
|
|
||||||
The following attributes are exported:
|
The following attributes are exported:
|
||||||
|
Loading…
Reference in New Issue
Block a user