AWS DynamoDB Table Item

This page shows how to write Terraform and CloudFormation for DynamoDB Table Item and write them securely.

aws_dynamodb_table_item (Terraform)

The Table Item in DynamoDB can be configured in Terraform with the resource name aws_dynamodb_table_item. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "aws_dynamodb_table_item" "hotel1" {
  table_name =
  hash_key   =

  item = <<ITEM
resource "aws_dynamodb_table_item" "dynamodb_prod_data_account_01" {
  table_name =
  hash_key   = aws_dynamodb_table.dynamodb_account_prod.hash_key

  item = data.template_file.dynamo_data_account_01.rendered


Explanation in Terraform Registry

Provides a DynamoDB table item resource -> Note: This resource is not meant to be used for managing large amounts of data in your table, it is not designed to scale. You should perform regular backups of all data in the table, see AWS docs for more.

AWS::DynamoDB::Table AttributeDefinition (CloudFormation)

The Table AttributeDefinition in DynamoDB can be configured in CloudFormation with the resource name AWS::DynamoDB::Table AttributeDefinition. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.


AttributeName A name for the attribute.
Required: Yes
Type: String
Minimum: 1
Maximum: 255
Update requires: No interruption

AttributeType The data type for the attribute, where:

  • S - the attribute is of type String
  • N - the attribute is of type Number
  • B - the attribute is of type Binary Required: Yes
    Type: String
    Allowed values: B | N | S
    Update requires: No interruption

Explanation in CloudFormation Registry

Represents an attribute for describing the key schema for the table and indexes.

Frequently asked questions

What is AWS DynamoDB Table Item?

AWS DynamoDB Table Item is a resource for DynamoDB of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS DynamoDB Table Item?

For Terraform, the hromovyi/meetup-xray-demo and aumoraes/safra-tecnee-invest-plus-iac source code examples are useful. See the Terraform Example section for further details.