-
Notifications
You must be signed in to change notification settings - Fork 7
/
dynamodb_3.tf
43 lines (35 loc) · 1.61 KB
/
dynamodb_3.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
locals {
dynamodb3_name = length(var.dynamodb3_name_override) > 0 ? var.dynamodb3_name_override : join("-", [var.name, "3"])
}
resource "null_resource" "dynamodb3_checker" {
provisioner "local-exec" {
command = "echo 'Condition failed. Expected: DynamoDB enabled, but hash_key not set' && exit 1"
}
count = var.dynamodb3_enabled && length(var.dynamodb3_hash_key) < 1 ? 1 : 0
}
module "dynamodb3" {
source = "cloudposse/dynamodb/aws"
version = "0.30.0"
namespace = ""
stage = ""
name = local.dynamodb3_name
hash_key = var.dynamodb3_hash_key
hash_key_type = var.dynamodb3_hash_key_type
range_key = var.dynamodb3_range_key
range_key_type = var.dynamodb3_range_key_type
enabled = var.dynamodb3_enabled
billing_mode = var.dynamodb3_billing
table_class = var.dynamodb3_table_class
dynamodb_attributes = var.dynamodb3_attributes
global_secondary_index_map = var.dynamodb3_global_secondary_index_map
local_secondary_index_map = var.dynamodb3_local_secondary_index_map
# We can always extend the defaults and add them
autoscale_write_target = var.dynamodb3_autoscale_write_target
autoscale_read_target = var.dynamodb3_autoscale_read_target
autoscale_min_read_capacity = var.dynamodb3_autoscale_min_read_capacity
autoscale_max_read_capacity = var.dynamodb3_autoscale_max_read_capacity
autoscale_min_write_capacity = var.dynamodb3_autoscale_min_write_capacity
autoscale_max_write_capacity = var.dynamodb3_autoscale_max_write_capacity
enable_autoscaler = var.dynamodb3_enable_autoscaler
tags = local.tags
}