You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/project-manifest/tables-indexes.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ Defines [Global Secondary Indexes][gsi] for your project's [DynamoDB][ddb] table
19
19
## Syntax
20
20
21
21
-`@tables-indexes` is a feature subset of [`@tables`][tables]; as such, the names of your declared indexes must match those of your [`@tables`][tables]
22
+
- AWS supports a maximum of 20 indexes per table
22
23
- Otherwise, the basic syntax for defining `@tables-indexes` primary keys is the same as [`@tables`][tables]:
23
24
- Partition key, defined by a `*`, is required
24
25
- Sort key, defined by `**`, is optional
@@ -32,6 +33,16 @@ Defines [Global Secondary Indexes][gsi] for your project's [DynamoDB][ddb] table
32
33
-`keys`: only the base table and index primary keys (and sort keys, if defined) are projected into the index
33
34
- Custom: otherwise, you may define one or more attribute names to explicitly project into the index. Note that the base table and index keys always get projected
34
35
36
+
## Deployment Considerations
37
+
38
+
⚠️ Be careful when [`arc deploy`](../cli/deploy)ing indexes! There are a few unique CloudFormation behaviours that happen behind the scenes that you should be aware of, please see the [Important callout on the CloudFormation reference page for Global Secondary Indexes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-globalsecondaryindexes). In particular:
39
+
40
+
- Creating a new index on an existing table can take time. While the index is being populated, you cannot update the table or use the index. Furthermore, CloudFormation will not block while the index is populating, so you should keep tabs on its state after creation.
41
+
- CloudFormation generally does not support index updating, aside from a few specific properties.
42
+
- You can only add or delete one index in each deploy.
43
+
44
+
Given the above, it's generally recommended to silo application updates to just the bare minimum when working with indexes.
45
+
35
46
## Example
36
47
37
48
The following `app.arc` file defines a [DynamoDB][ddb] table with two named [Global Secondary Indexes][gsi], both with `projection` explicitly defined:
0 commit comments