terraform-aws-dynamodb

Terraform module to provision a DynamoDB table with autoscaling.

Terraform AWS DynamoDB

GitHub Repo https://github.com/cloudposse/terraform-aws-dynamodb
Terraform Module terraform-aws-dynamodb
Release Release
Build Status Build Status

Autoscaler scales up/down the provisioned IOPS for the DynamoDB table based on the load.

Usage

Include this module in your existing terraform code:

HCL
module "dynamodb_table" {
  source                           = "git::https://github.com/cloudposse/terraform-aws-dynamodb.git?ref=master"
  domain_name                      = "example.com"
  proces_domain_validation_options = "true"
  ttl                              = "300"
}

Variables

Name Default Description Required
namespace `` Namespace (e.g. cp or cloudposse) Yes
delimiter - Delimiter to be used between namespace, stage, name, and attributes No
autoscale_write_target 10 The target value for DynamoDB write autoscaling No
autoscale_read_target 10 The target value for DynamoDB read autoscaling No
autoscale_min_read_capacity 5 DynamoDB autoscaling min read capacity No
autoscale_max_read_capacity 20 DynamoDB autoscaling max read capacity No
autoscale_min_write_capacity 5 DynamoDB autoscaling min write capacity No
autoscale_max_write_capacity 20 DynamoDB autoscaling max write capaci No
enable_autoscaler true Flag to enable/disable DynamoDB autoscaling No
stage `` Stage (e.g. prod, dev, staging) Yes
name `` Name (e.g. app or cluster) Yes
hash_key `` DynamoDB table Hash Key Yes
range_key `` DynamoDB table Range Key Yes
ttl_attribute `` DynamoDB table TTL attribute No
enable_encryption true Enable DynamoDB server-side encryption No
attributes [] Additional attributes (e.g. policy or role) No
tags {} Additional tags (e.g. map("BusinessUnit","XYZ") No

Outputs

Name Description
table_id DynamoDB table ID
table_arn DynamoDB table ARN
table_name DynamoDB table name