A Table represents an Amazon DynamoDB table. DynamoDB is a NoSQL database that offers predictable performance and is perfect for storing the data of your serverless applications.
Key Features of DynamoDB include:
- Fully-managed by AWS
- Ability to store an unlimited amount of data
- Pricing based on throughput capacity instead of storage
- Secure authentication methods to protect data
- Highly available data via automatic Multi-AZ replication
Your tables partition data based on a Hash Key (also known as a Partition Key). The Hash Key is a value that all records must have, and is typically used to identify or segment records. Tables may optionally have a Range Key (also known as a Sort Key), which sorts records with the same Hash Key according to the Range Key value. See the DynamoDB Core Components documentation for a more complete discussion of keys, records, and attributes.
Event subscription wires (solid line) connect two or more resources and are required to accomplish certain tasks or improve performance within an application's flow.
The following resources can be subscribed to a Table:
Service discovery wires (dashed line) provide compute resources (Function, Edge Function, Docker Task) with the permissions and environment variables required to perform actions using cloud resources within the stack. This resource is on the receiving end of a service discovery wire originating from compute resources.
The following compute resources can use a service discovery wire to access a Secrets resource:
Human readable name for this resource that is displayed on the Stackery Dashboard and Stackery CLI output.
The unique identifier used to reference this resource in the stack template. Defining a custom Logical ID is recommended, as it allows you to quickly identify a resource and any associated sub-resources when working with your stack in AWS, or anywhere outside of the Stackery Dashboard. As a project grows, it becomes useful in quickly spotting this resource in
template.yaml or while viewing a stack in Template View mode.
The Logical ID of all sub-resources associated with this Table will be prefixed with this value.
The identifier you provide must only contain alphanumeric characters (A-Za-z0-9) and be unique within the stack.
Default Logical ID Example:
IMPORTANT : AWS uses the Logical ID of each resource to coordinate and apply updates to the stack when deployed. On any update of a resource's logical ID (or any modification that results in one), CloudFormation will delete the currently deployed resource and create a new one in it's place when the updated stack is deployed.
Hash Key Name
In DynamoDB tables, there is a field required in every row that is used for indexing. No two items in your DynamoDB table can have the same Hash Key value so be sure to choose a unique identifier. Hash key names may contain only letters, numbers, and underscores.
The Hash Key Name may not be changed after deployment.
Hash Key Type
The type of your Hash Key attribute.
Range Key Name (optional)
If a Range Key is used, the name of the Range Key attribute and its type. Range Key names may contain only letters, numbers, and underscores.
The Range Key Name may not be changed after deployment.
Range Key Type (optional)
The type of your Range Key attribute.
Expiration Key (optional)
If an Expiration Key is used, the name of the Expiration Key attribute. The attribute contains a timestamp indicating when the item should be deleted.
Use Existing DynamoDB Table
When enabled, this feature provides you with a field to specify the Amazon Resource Name (ARN) of an existing DynamoDB Table to reference in your application.
You may reference an environment parameter in order to conditionally reference existing infrastructure based on environment.
When connected by a service discovery wire (dashed wire), a Function or Docker Task will add the following IAM statement/policy to its role and gain permission to access this resource.
Grants a Function or Docker Task permission to create, read, update, and delete items from a Table resource within the stack or an existing DynamoDB Table outside of the current stack.
When connected by a service discovery wire (dashed wire), a Function or Docker Task will automatically populate and reference the following environment variables in order to interact with this resource.
The Logical ID of the Table resource.
The Amazon Resource Name of the Table.
Metrics & Logs
Double clicking a resource while viewing your stack's current deployment gives you access to your pre-configured resource properties, and the following metrics and logs.
- Read Capacity Units
- Throttled Reads
- Write Capacity Units
- Throttled Writes
- Request Latency
- Error Metrics
Related AWS Documentation
AWS Documentation: AWS::DynamoDB::Table