-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
192 lines (161 loc) · 5.56 KB
/
Copy pathvariables.tf
File metadata and controls
192 lines (161 loc) · 5.56 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
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
183
184
185
186
187
188
189
190
191
192
variable "create_bucket" {
description = "Controls if OBS bucket should be created"
type = bool
default = true
}
variable "region" {
description = "Region where the resource(s) will be managed. Defaults to the region set in the provider configuration"
type = string
default = null
}
variable "bucket" {
description = "(Optional, Forces new resource) The name of the bucket. If omitted, Terraform can assign a unique name, but for OBS it's recommended to set explicitly"
type = string
default = null
}
variable "acl" {
description = "(Optional) The canned ACL to apply. Valid: private, public-read, public-read-write, log-delivery-write"
type = string
default = null
}
variable "tags" {
description = "(Optional) A mapping of tags to assign to the bucket"
type = map(string)
default = {}
}
variable "force_destroy" {
description = "(Optional, Default:false) Delete all objects so the bucket can be destroyed without error"
type = bool
default = false
}
variable "storage_class" {
description = "(Optional) Storage class of the bucket: STANDARD, WARM, COLD"
type = string
default = null
}
variable "versioning" {
description = "(Optional) Enable object versioning on the bucket"
type = bool
default = null
}
variable "multi_az" {
description = "(Optional, ForceNew) Whether to enable multi-AZ mode for the bucket. Data will be replicated across multiple availability zones for higher availability and durability. Once a bucket is created, you cannot enable or disable multi-AZ mode. Changing this will create a new bucket. Note: Not all regions support single-AZ or multi-AZ storage. Some regions may require multi-AZ by default"
type = bool
default = null
}
variable "enterprise_project_id" {
description = "(Optional) The enterprise project ID to which the bucket belongs. Used for enterprise project management and resource organization"
type = string
default = null
}
variable "quota" {
description = "(Optional) The bucket quota in bytes. Maximum storage capacity for the bucket. Set to 0 for unlimited storage (default)"
type = number
default = 0
}
variable "encryption" {
description = "(Optional) Whether to enable default server-side encryption of the bucket"
type = bool
default = null
}
variable "sse_algorithm" {
description = "(Optional) SSE algorithm: kms (KMS-managed) or AES256 (OBS-managed)"
type = string
default = null
}
variable "kms_key_id" {
description = "(Optional) KMS key ID used when sse_algorithm is kms"
type = string
default = null
}
variable "kms_key_project_id" {
description = "(Optional) Project ID to which the KMS key belongs (valid only when kms_key_id is specified)"
type = string
default = null
}
################################################################################
# Bucket Policy
################################################################################
variable "attach_policy" {
description = "Controls if bucket policy should be attached to the bucket"
type = bool
default = false
}
variable "policy" {
description = "Text of the bucket policy in JSON format"
type = string
default = null
}
variable "policy_format" {
description = "Policy format: obs or s3"
type = string
default = "obs"
}
################################################################################
# Lifecycle Rules
################################################################################
variable "lifecycle_rules" {
description = "List of lifecycle rules for the bucket"
type = list(object({
name = string
enabled = bool
prefix = optional(string)
expiration = optional(object({
days = number
}))
transition = optional(list(object({
days = number
storage_class = string
})))
noncurrent_version_expiration = optional(object({
days = number
}))
noncurrent_version_transition = optional(list(object({
days = number
storage_class = string
})))
abort_incomplete_multipart_upload = optional(object({
days = number
}))
}))
default = []
}
################################################################################
# CORS Rules
################################################################################
variable "cors_rules" {
description = "List of CORS rules for the bucket"
type = list(object({
allowed_origins = list(string)
allowed_methods = list(string)
allowed_headers = optional(list(string))
expose_headers = optional(list(string))
max_age_seconds = optional(number)
}))
default = []
}
################################################################################
# Logging
################################################################################
variable "logging" {
description = "Bucket logging configuration"
type = object({
target_bucket = string
target_prefix = optional(string)
agency = string
})
default = null
}
################################################################################
# Website Hosting
################################################################################
variable "website" {
description = "Static website hosting configuration"
type = object({
index_document = optional(string)
error_document = optional(string)
redirect_all_requests_to = optional(string)
routing_rules = optional(string)
})
default = null
}