-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathvariables.tf
309 lines (261 loc) · 9.4 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
variable "create_role" {
description = "Whether to create a role"
type = bool
default = true
}
variable "role_name" {
description = "Name of IAM role"
type = string
default = null
}
variable "role_path" {
description = "Path of IAM role"
type = string
default = "/"
}
variable "role_permissions_boundary_arn" {
description = "Permissions boundary ARN to use for IAM role"
type = string
default = null
}
variable "role_description" {
description = "IAM Role description"
type = string
default = null
}
variable "role_name_prefix" {
description = "IAM role name prefix"
type = string
default = null
}
variable "policy_name_prefix" {
description = "IAM policy name prefix"
type = string
default = "AmazonEKS_"
}
variable "role_policy_arns" {
description = "ARNs of any policies to attach to the IAM role"
type = map(string)
default = {}
}
variable "oidc_providers" {
description = "Map of OIDC providers where each provider map should contain the `provider`, `provider_arn`, and `namespace_service_accounts`"
type = any
default = {}
}
variable "tags" {
description = "A map of tags to add the the IAM role"
type = map(any)
default = {}
}
variable "force_detach_policies" {
description = "Whether policies should be detached from this role when destroying"
type = bool
default = true
}
variable "max_session_duration" {
description = "Maximum CLI/API session duration in seconds between 3600 and 43200"
type = number
default = null
}
variable "assume_role_condition_test" {
description = "Name of the [IAM condition operator](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html) to evaluate when assuming the role"
type = string
default = "StringEquals"
}
variable "allow_self_assume_role" {
description = "Determines whether to allow the role to be [assume itself](https://aws.amazon.com/blogs/security/announcing-an-update-to-iam-role-trust-policy-behavior/)"
type = bool
default = false
}
################################################################################
# Policies
################################################################################
# Cert Manager
variable "attach_cert_manager_policy" {
description = "Determines whether to attach the Cert Manager IAM policy to the role"
type = bool
default = false
}
variable "cert_manager_hosted_zone_arns" {
description = "Route53 hosted zone ARNs to allow Cert manager to manage records"
type = list(string)
default = ["arn:aws:route53:::hostedzone/*"]
}
# Cluster autoscaler
variable "attach_cluster_autoscaler_policy" {
description = "Determines whether to attach the Cluster Autoscaler IAM policy to the role"
type = bool
default = false
}
variable "cluster_autoscaler_cluster_ids" {
description = "List of cluster IDs to appropriately scope permissions within the Cluster Autoscaler IAM policy"
type = list(string)
default = []
}
# EBS CSI
variable "attach_ebs_csi_policy" {
description = "Determines whether to attach the EBS CSI IAM policy to the role"
type = bool
default = false
}
variable "ebs_csi_kms_cmk_ids" {
description = "KMS CMK IDs to allow EBS CSI to manage encrypted volumes"
type = list(string)
default = []
}
# EFS CSI
variable "attach_efs_csi_policy" {
description = "Determines whether to attach the EFS CSI IAM policy to the role"
type = bool
default = false
}
# External DNS
variable "attach_external_dns_policy" {
description = "Determines whether to attach the External DNS IAM policy to the role"
type = bool
default = false
}
variable "external_dns_hosted_zone_arns" {
description = "Route53 hosted zone ARNs to allow External DNS to manage records"
type = list(string)
default = ["arn:aws:route53:::hostedzone/*"]
}
# External Secrets
variable "attach_external_secrets_policy" {
description = "Determines whether to attach the External Secrets policy to the role"
type = bool
default = false
}
variable "external_secrets_ssm_parameter_arns" {
description = "List of Systems Manager Parameter ARNs that contain secrets to mount using External Secrets"
type = list(string)
default = ["arn:aws:ssm:*:*:parameter/*"]
}
variable "external_secrets_secrets_manager_arns" {
description = "List of Secrets Manager ARNs that contain secrets to mount using External Secrets"
type = list(string)
default = ["arn:aws:secretsmanager:*:*:secret:*"]
}
# FSx Lustre CSI
variable "attach_fsx_lustre_csi_policy" {
description = "Determines whether to attach the FSx for Lustre CSI Driver IAM policy to the role"
type = bool
default = false
}
variable "fsx_lustre_csi_service_role_arns" {
description = "Service role ARNs to allow FSx for Lustre CSI create and manage FSX for Lustre service linked roles"
type = list(string)
default = ["arn:aws:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/*"]
}
# Karpenter controller
variable "attach_karpenter_controller_policy" {
description = "Determines whether to attach the Karpenter Controller policy to the role"
type = bool
default = false
}
variable "karpenter_controller_cluster_id" {
description = "Cluster ID where the Karpenter controller is provisioned/managing"
type = string
default = "*"
}
variable "karpenter_tag_key" {
description = "Tag key (`{key = value}`) applied to resources launched by Karpenter through the Karpenter provisioner"
type = string
default = "karpenter.sh/discovery"
}
variable "karpenter_controller_ssm_parameter_arns" {
description = "List of SSM Parameter ARNs that contain AMI IDs launched by Karpenter"
type = list(string)
# https://github.com/aws/karpenter/blob/ed9473a9863ca949b61b9846c8b9f33f35b86dbd/pkg/cloudprovider/aws/ami.go#L105-L123
default = ["arn:aws:ssm:*:*:parameter/aws/service/*"]
}
variable "karpenter_controller_node_iam_role_arns" {
description = "List of node IAM role ARNs Karpenter can use to launch nodes"
type = list(string)
default = ["*"]
}
variable "karpenter_subnet_account_id" {
description = "Account ID of where the subnets Karpenter will utilize resides. Used when subnets are shared from another account"
type = string
default = ""
}
variable "karpenter_sqs_queue_arn" {
description = "(Optional) ARN of SQS used by Karpenter when native node termination handling is enabled"
type = string
default = null
}
# AWS Load Balancer Controller
variable "attach_load_balancer_controller_policy" {
description = "Determines whether to attach the Load Balancer Controller policy to the role"
type = bool
default = false
}
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/targetgroupbinding/targetgroupbinding/#reference
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/deploy/installation/#setup-iam-manually
variable "attach_load_balancer_controller_targetgroup_binding_only_policy" {
description = "Determines whether to attach the Load Balancer Controller policy for the TargetGroupBinding only"
type = bool
default = false
}
# AWS Appmesh Controller
variable "attach_appmesh_controller_policy" {
description = "Determines whether to attach the Appmesh Controller policy to the role"
type = bool
default = false
}
# AWS Appmesh envoy proxy
variable "attach_appmesh_envoy_proxy_policy" {
description = "Determines whether to attach the Appmesh envoy proxy policy to the role"
type = bool
default = false
}
# Amazon Managed Service for Prometheus
variable "attach_amazon_managed_service_prometheus_policy" {
description = "Determines whether to attach the Amazon Managed Service for Prometheus IAM policy to the role"
type = bool
default = false
}
variable "amazon_managed_service_prometheus_workspace_arns" {
description = "List of AMP Workspace ARNs to read and write metrics"
type = list(string)
default = ["*"]
}
# Velero
variable "attach_velero_policy" {
description = "Determines whether to attach the Velero IAM policy to the role"
type = bool
default = false
}
variable "velero_s3_bucket_arns" {
description = "List of S3 Bucket ARNs that Velero needs access to in order to backup and restore cluster resources"
type = list(string)
default = ["*"]
}
# VPC CNI
variable "attach_vpc_cni_policy" {
description = "Determines whether to attach the VPC CNI IAM policy to the role"
type = bool
default = false
}
variable "vpc_cni_enable_ipv4" {
description = "Determines whether to enable IPv4 permissions for VPC CNI policy"
type = bool
default = false
}
variable "vpc_cni_enable_ipv6" {
description = "Determines whether to enable IPv6 permissions for VPC CNI policy"
type = bool
default = false
}
# Node termination handler
variable "attach_node_termination_handler_policy" {
description = "Determines whether to attach the Node Termination Handler policy to the role"
type = bool
default = false
}
variable "node_termination_handler_sqs_queue_arns" {
description = "List of SQS ARNs that contain node termination events"
type = list(string)
default = ["*"]
}