-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
131 lines (112 loc) · 3.48 KB
/
variables.tf
File metadata and controls
131 lines (112 loc) · 3.48 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// variables.tf
variable "project_name" {
description = "Name of the project"
type = string
}
variable "environment" {
description = "Environment (e.g., prod, dev, test)"
type = string
}
variable "name_prefix" {
description = "Prefix for resource names (if not provided, will use project-environment pattern)"
type = string
default = ""
}
variable "table_name" {
description = "Name of the DynamoDB table (if empty, will use project-environment pattern)"
type = string
default = ""
}
variable "tags" {
description = "Additional tags for all resources"
type = map(string)
default = {}
}
variable "billing_mode" {
description = "Controls how you are charged for read and write throughput and how you manage capacity (PROVISIONED or PAY_PER_REQUEST)"
type = string
default = "PAY_PER_REQUEST"
validation {
condition = contains(["PROVISIONED", "PAY_PER_REQUEST"], var.billing_mode)
error_message = "Billing mode must be one of: PROVISIONED, PAY_PER_REQUEST."
}
}
variable "hash_key" {
description = "The attribute to use as the hash (partition) key"
type = string
}
variable "range_key" {
description = "The attribute to use as the range (sort) key"
type = string
default = null
}
variable "attributes" {
description = "List of nested attribute definitions. Only required for hash_key and range_key attributes"
type = list(object({
name = string
type = string
}))
}
variable "global_secondary_indexes" {
description = "Describe a GSI for the table"
type = 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)
}))
default = []
}
variable "local_secondary_indexes" {
description = "Describe an LSI for the table"
type = list(object({
name = string
range_key = string
projection_type = string
non_key_attributes = optional(list(string))
}))
default = []
}
variable "point_in_time_recovery_enabled" {
description = "Whether to enable point-in-time recovery"
type = bool
default = true # Best practice: always enable for data protection
}
variable "kms_key_arn" {
description = "The ARN of the KMS key to use for server-side encryption"
type = string
default = "" # If empty, uses AWS managed key
}
variable "deletion_protection_enabled" {
description = "Whether to enable deletion protection for the table"
type = bool
default = true # Security first: prevent accidental deletion
}
variable "resource_policy" {
description = "The JSON-formatted resource-based policy to apply to the DynamoDB table"
type = string
default = ""
}
variable "stream_enabled" {
description = "Indicates whether Streams are to be enabled"
type = bool
default = false
}
variable "stream_view_type" {
description = "When an item in the table is modified, StreamViewType determines what information is written to the table's stream"
type = string
default = ""
}
variable "ttl_enabled" {
description = "Indicates whether TTL is enabled"
type = bool
default = false
}
variable "ttl_attribute_name" {
description = "The name of the table attribute to store the TTL timestamp in"
type = string
default = ""
}