forked from nozaq/terraform-aws-remote-state-s3-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
183 lines (150 loc) · 5.96 KB
/
variables.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#---------------------------------------------------------------------------------------------------
# General
#---------------------------------------------------------------------------------------------------
variable "tags" {
description = "A mapping of tags to assign to resources."
type = map(string)
default = {
Terraform = "true"
}
}
#---------------------------------------------------------------------------------------------------
# IAM Policy for Executing Terraform with Remote States
#---------------------------------------------------------------------------------------------------
variable "terraform_iam_policy_create" {
description = "Specifies whether to terraform IAM policy is created."
type = bool
default = true
}
variable "terraform_iam_policy_name_prefix" {
description = "Creates a unique name beginning with the specified prefix."
type = string
default = "terraform"
}
#---------------------------------------------------------------------------------------------------
# KMS Key for Encrypting S3 Buckets
#---------------------------------------------------------------------------------------------------
variable "kms_key_description" {
description = "The description of the key as viewed in AWS console."
type = string
default = "The key used to encrypt the remote state bucket."
}
variable "kms_key_deletion_window_in_days" {
description = "Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days."
type = number
default = 30
}
variable "kms_key_enable_key_rotation" {
description = "Specifies whether key rotation is enabled."
type = bool
default = true
}
#---------------------------------------------------------------------------------------------------
# S3 Buckets
#---------------------------------------------------------------------------------------------------
variable "enable_replication" {
description = "Set this to true to enable S3 bucket replication in another region"
type = bool
default = true
}
variable "state_bucket_prefix" {
description = "Creates a unique state bucket name beginning with the specified prefix."
type = string
default = "tf-remote-state"
}
variable "replica_bucket_prefix" {
description = "Creates a unique replica bucket name beginning with the specified prefix."
type = string
default = "tf-remote-state-replica"
}
variable "iam_role_arn" {
description = "Use IAM role of specified ARN for s3 replication instead of creating it."
type = string
default = null
}
variable "iam_role_name_prefix" {
description = "Creates a unique name beginning with the specified prefix."
type = string
default = "tf-remote-state-replication-role"
}
variable "iam_policy_name_prefix" {
description = "Creates a unique name beginning with the specified prefix."
type = string
default = "tf-remote-state-replication-policy"
}
variable "iam_policy_attachment_name" {
description = "The name of the attachment."
type = string
default = "tf-iam-role-attachment-replication-configuration"
}
variable "noncurrent_version_transitions" {
description = "Specifies when noncurrent object versions transitions. See the aws_s3_bucket document for detail."
type = list(object({
days = number
storage_class = string
}))
default = [
{
days = 7
storage_class = "GLACIER"
}
]
}
variable "noncurrent_version_expiration" {
description = "Specifies when noncurrent object versions expire. See the aws_s3_bucket document for detail."
type = object({
days = number
})
default = null
}
variable "s3_bucket_force_destroy" {
description = "A boolean that indicates all objects should be deleted from S3 buckets so that the buckets can be destroyed without error. These objects are not recoverable."
type = bool
default = false
}
variable "s3_logging_target_bucket" {
description = "The name of the bucket for log storage. The \"S3 log delivery group\" should have Objects-write und ACL-read permissions on the bucket."
type = string
default = null
}
variable "s3_logging_target_prefix" {
description = "The prefix to apply on bucket logs, e.g \"logs/\"."
type = string
default = ""
}
#---------------------------------------------------------------------------------------------------
# DynamoDB Table for State Locking
#---------------------------------------------------------------------------------------------------
variable "dynamodb_table_name" {
description = "The name of the DynamoDB table to use for state locking."
type = string
default = "tf-remote-state-lock"
}
variable "dynamodb_table_billing_mode" {
description = "Controls how you are charged for read and write throughput and how you manage capacity."
type = string
default = "PAY_PER_REQUEST"
}
variable "dynamodb_enable_server_side_encryption" {
description = "Whether or not to enable encryption at rest using an AWS managed KMS customer master key (CMK)"
type = bool
default = false
}
#---------------------------------------------------------------------------------------------------
# Optionally specifying a fixed bucket name
#---------------------------------------------------------------------------------------------------
variable "override_s3_bucket_name" {
description = "override s3 bucket name to disable bucket_prefix and create bucket with static name"
type = bool
default = false
}
variable "s3_bucket_name" {
description = "If override_s3_bucket_name is true, use this bucket name instead of dynamic name with bucket_prefix"
type = string
default = ""
}
variable "s3_bucket_name_replica" {
description = "If override_s3_bucket_name is true, use this bucket name for replica instead of dynamic name with bucket_prefix"
type = string
default = ""
}