Skip to content

tfstack/terraform-aws-dynamodb-table

Repository files navigation

terraform-aws-dynamodb-table

Terraform module for creating and managing DynamoDB tables

Requirements

Name Version
terraform >= 1.0
aws >= 6.0

Providers

Name Version
aws 6.10.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_dashboard.this resource
aws_dynamodb_table.this resource
aws_iam_policy.basic_table_policy resource
aws_iam_policy.custom_table_policy resource
aws_iam_policy_document.basic_table_policy data source
aws_region.current data source

Inputs

Name Description Type Default Required
allowed_actions List of DynamoDB actions to allow in the basic policy list(string)
[
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:Query",
"dynamodb:Scan"
]
no
attributes List of nested attribute definitions. Only required for hash_key and range_key attributes
list(object({
name = string
type = string
}))
n/a yes
billing_mode Controls how you are charged for read and write throughput and how you manage capacity string "PAY_PER_REQUEST" no
cloudwatch_dashboard_enabled Whether to create a CloudWatch dashboard for the DynamoDB table bool false no
create_table_policy Whether to create a basic IAM policy for the DynamoDB table bool false no
dashboard_name Name of the CloudWatch dashboard. If not provided, defaults to table name with '-dashboard' suffix string null no
global_secondary_indexes List of global secondary indexes to create
list(object({
name = string
hash_key = string
range_key = optional(string)
projection_type = string
non_key_attributes = optional(list(string))
read_capacity = optional(number)
write_capacity = optional(number)
}))
[] no
hash_key The attribute to use as the hash (partition) key string n/a yes
kms_key_arn The ARN of the CMK that should be used for the AWS KMS encryption string null no
local_secondary_indexes List of local secondary indexes to create
list(object({
name = string
range_key = string
projection_type = string
non_key_attributes = optional(list(string))
}))
[] no
name Name of the DynamoDB table string n/a yes
point_in_time_recovery Point-in-time recovery options
object({
enabled = bool
})
{
"enabled": false
}
no
range_key The attribute to use as the range (sort) key string null no
read_capacity The number of read units for this table. If the billing_mode is PROVISIONED, this field is required number null no
server_side_encryption_enabled Indicates whether server-side encryption is enabled bool true no
stream_enabled Indicates whether Streams are to be enabled (true) or disabled (false) bool false no
stream_view_type When an item in the table is modified, StreamViewType determines what information is written to the table's stream string null no
table_policy Custom IAM policy document for the DynamoDB table string null no
tags A map of tags to assign to the resource map(string) {} no
write_capacity The number of write units for this table. If the billing_mode is PROVISIONED, this field is required number null no

Outputs

Name Description
basic_policy_arn ARN of the basic IAM policy (if created)
custom_policy_arn ARN of the custom IAM policy (if provided)
dashboard_name CloudWatch dashboard name
dashboard_url CloudWatch dashboard URL
table_arn DynamoDB table ARN
table_id DynamoDB table ID
table_name DynamoDB table name
table_stream_arn DynamoDB table stream ARN
table_stream_label DynamoDB table stream label

About

Terraform module for creating and managing DynamoDB tables

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages