aws_table.md

April 1, 2019 ยท View on GitHub

Document: "dynamodb"

Path: "https://github.com/aws/aws-sdk-go-v2/tree/master/models/apis/dynamodb/2012-08-10/api-2.json")

Table

aws_table {
  attribute_definitions => "AttributeDefinitions (optional)",
  billing_mode => $aws_billing_mode
  global_secondary_indexes => "GlobalSecondaryIndexes (optional)",
  key_schema => "KeySchema (optional)",
  local_secondary_indexes => "LocalSecondaryIndexes (optional)",
  provisioned_throughput => $aws_provisioned_throughput
  sse_specification => $aws_sse_specification
  stream_specification => $aws_stream_specification
  table_name => $aws_table_name
}
NameTypeRequired
attribute_definitionsAttributeDefinitionsfalse
billing_modeBillingModefalse
global_secondary_indexesGlobalSecondaryIndexListfalse
key_schemaKeySchemafalse
local_secondary_indexesLocalSecondaryIndexListfalse
provisioned_throughputProvisionedThroughputfalse
sse_specificationSSESpecificationfalse
stream_specificationStreamSpecificationfalse
table_nameTableNamefalse

CRUD operations

Here is a list of endpoints that we use to create, read, update and delete the Table

OperationPathVerbDescriptionOperationID
Create/POST

The CreateTable operation adds a new table to your account. In an AWS account, table names must be unique within each region. That is, you can have two tables with same name if you create the tables in different regions.

CreateTable is an asynchronous operation. Upon receiving a CreateTable request, DynamoDB immediately returns a response with a TableStatus of CREATING. After the table is created, DynamoDB sets the TableStatus to ACTIVE. You can perform read and write operations only on an ACTIVE table.

You can optionally define secondary indexes on the new table, as part of the CreateTable operation. If you want to create multiple tables with secondary indexes on them, you must create the tables sequentially. Only one table with secondary indexes can be in the CREATING state at any given time.

You can use the DescribeTable action to check the table status.

CreateTable
List - list all``
List - get one/POST

Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.

If you issue a DescribeTable request immediately after a CreateTable request, DynamoDB might return a ResourceNotFoundException. This is because DescribeTable uses an eventually consistent query, and the metadata for your table might not be available at that moment. Wait for a few seconds, and then try the DescribeTable request again.

DescribeTable
List - get list using params``
Update``
Delete/POST

The DeleteTable operation deletes a table and all of its items. After a DeleteTable request, the specified table is in the DELETING state until DynamoDB completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is in CREATING or UPDATING states, then DynamoDB returns a ResourceInUseException. If the specified table does not exist, DynamoDB returns a ResourceNotFoundException. If table is already in the DELETING state, no error is returned.

DynamoDB might continue to accept data read and write operations, such as GetItem and PutItem, on a table in the DELETING state until the table deletion is complete.

When you delete a table, any indexes on that table are also deleted.

If you have DynamoDB Streams enabled on the table, then the corresponding stream on that table goes into the DISABLED state, and the stream is automatically deleted after 24 hours.

Use the DescribeTable action to check the status of the table.

DeleteTable