This repository has been archived by the owner on Dec 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
variables.tf
221 lines (198 loc) · 7.99 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# -------------------------------------------------------------------------------------------------
# Policy definition
# -------------------------------------------------------------------------------------------------
# Example policy definition:
#
# policies = [
# {
# name = "default-permission-boundary"
# path = "/boundaries/human/"
# desc = "Provides default permission boundary for assume roles"
# file = "boundaries/default.json.tmpl"
# vars = {
# currencryDescripe = "*",
# }
# },
# {
# name = "assume-human-ro-billing"
# path = "/assume/human/"
# desc = "Provides read-only access to billing"
# file = "policies/human/ro-billing.json"
# vars = {}
# },
# {
# name = "sqs-ro"
# path = "/custom/human/"
# desc = "Provides read-only access to SQS"
# file = "policies/human/sqs-ro.json"
# vars = {}
# },
# ]
variable "policies" {
description = "A list of dictionaries defining all policies."
type = list(object({
name = string # Name of the policy
path = string # Defaults to 'var.policy_path' variable is set to null
desc = string # Defaults to 'var.policy_desc' variable is set to null
file = string # Path to json or json.tmpl file of policy
vars = map(string) # Policy template variables {key: val, ...}
}))
default = []
}
# -------------------------------------------------------------------------------------------------
# Role definition
# -------------------------------------------------------------------------------------------------
# Example role definition:
#
# roles = [
# {
# name = "ASSUME-ADMIN"
# path = ""
# desc = ""
# trust_policy_file = "trust-policies/eng-ops.json"
# permissions_boundary = null
# policies = []
# inline_policies = []
# policy_arns = [
# "arn:aws:iam::aws:policy/AdministratorAccess",
# ]
# },
# {
# name = "ASSUME-DEV"
# path = ""
# desc = ""
# trust_policy_file = "trust-policies/eng-dev.json"
# permissions_boundary = "arn:aws:iam::aws:policy/my-boundary"
# policies = [
# "assume-human-ro-billing",
# ]
# inline_policies = []
# policy_arns = [
# "arn:aws:iam::aws:policy/PowerUserAccess",
# ]
# },
# ]
variable "roles" {
description = "A list of dictionaries defining all roles."
type = list(object({
name = string # Name of the role
path = string # Defaults to 'var.role_path' variable is set to null
desc = string # Defaults to 'var.role_desc' variable is set to null
trust_policy_file = string # Path to file of trust/assume policy
permissions_boundary = string # ARN to a policy used as permissions boundary (or null/empty)
policies = list(string) # List of names of policies (must be defined in var.policies)
inline_policies = list(object({
name = string # Name of the inline policy
file = string # Path to json or json.tmpl file of policy
vars = map(string) # Policy template variables {key = val, ...}
}))
policy_arns = list(string) # List of existing policy ARN's
}))
}
# -------------------------------------------------------------------------------------------------
# User definition
# -------------------------------------------------------------------------------------------------
# Example user definition:
#
# users = [
# {
# name = "ADMIN-USER"
# path = ""
# access_keys = [
# {
# name = "key1"
# pgp_key = ""
# status = ""
# },
# {
# name = "key2"
# pgp_key = ""
# status = ""
# }
# ]
# permissions_boundary = null
# policies = []
# inline_policies = []
# policy_arns = [
# "arn:aws:iam::aws:policy/AdministratorAccess",
# ]
# },
# {
# name = "POWER-USER"
# path = ""
# access_keys = []
# permissions_boundary = "arn:aws:iam::aws:policy/my-boundary"
# policies = [
# "assume-human-ro-billing",
# ]
# inline_policies = []
# policy_arns = [
# "arn:aws:iam::aws:policy/PowerUserAccess",
# ]
# },
# ]
variable "users" {
description = "A list of dictionaries defining all users."
type = list(object({
name = string # Name of the user
path = string # Defaults to 'var.user_path' variable is set to null
access_keys = list(object({
name = string # IaC identifier for first or second IAM access key (not used on AWS)
pgp_key = string # Leave empty for non or provide a b64-enc pubkey or keybase username
status = string # 'Active' or 'Inactive'
}))
permissions_boundary = string # ARN to a policy used as permissions boundary (or null/empty)
policies = list(string) # List of names of policies (must be defined in var.policies)
inline_policies = list(object({
name = string # Name of the inline policy
file = string # Path to json or json.tmpl file of policy
vars = map(string) # Policy template variables {key = val, ...}
}))
policy_arns = list(string) # List of existing policy ARN's
}))
}
# -------------------------------------------------------------------------------------------------
# Default Policy settings
# -------------------------------------------------------------------------------------------------
variable "policy_path" {
description = "The default path under which to create the policy if not specified in the policies list. You can use a single path, or nest multiple paths as if they were a folder structure. For example, you could use the nested path /division_abc/subdivision_xyz/product_1234/engineering/ to match your company's organizational structure."
default = "/"
}
variable "policy_desc" {
description = "The default description of the policy."
default = "Managed by Terraform"
}
# -------------------------------------------------------------------------------------------------
# Default Role settings
# -------------------------------------------------------------------------------------------------
variable "role_path" {
description = "The path under which to create the role. You can use a single path, or nest multiple paths as if they were a folder structure. For example, you could use the nested path /division_abc/subdivision_xyz/product_1234/engineering/ to match your company's organizational structure."
default = "/"
}
variable "role_desc" {
description = "The description of the role."
default = "Managed by Terraform"
}
variable "role_max_session_duration" {
description = "The maximum session duration (in seconds) that you want to set for the specified role. This setting can have a value from 1 hour to 12 hours specified in seconds."
default = "3600"
}
variable "role_force_detach_policies" {
description = "Specifies to force detaching any policies the role has before destroying it."
default = true
}
# -------------------------------------------------------------------------------------------------
# Default User settings
# -------------------------------------------------------------------------------------------------
variable "user_path" {
description = "The path under which to create the user. You can use a single path, or nest multiple paths as if they were a folder structure. For example, you could use the nested path /division_abc/subdivision_xyz/product_1234/engineering/ to match your company's organizational structure."
default = "/"
}
# -------------------------------------------------------------------------------------------------
# Default general settings
# -------------------------------------------------------------------------------------------------
variable "tags" {
description = "Key-value mapping of tags for the IAM role or user."
type = map(any)
default = {}
}