-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
variables.tf
139 lines (118 loc) · 4.22 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
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "name" {
description = "Name for both service accounts. The GCP SA will be truncated to the first 30 chars if necessary."
type = string
}
variable "project_id" {
description = "GCP project ID"
type = string
}
variable "gcp_sa_name" {
description = "Name for the Google service account; overrides `var.name`."
type = string
default = null
}
variable "use_existing_gcp_sa" {
description = "Use an existing Google service account instead of creating one"
type = bool
default = false
}
variable "cluster_name" {
description = "Cluster name. Required if using existing KSA."
type = string
default = ""
}
variable "location" {
description = "Cluster location (region if regional cluster, zone if zonal cluster). Required if using existing KSA."
type = string
default = ""
}
variable "k8s_sa_name" {
description = "Name for the Kubernetes service account; overrides `var.name`. `cluster_name` and `location` must be set when this input is specified."
type = string
default = null
}
variable "k8s_sa_project_id" {
description = "GCP project ID of the k8s service account; overrides `var.project_id`."
type = string
default = null
}
variable "namespace" {
description = "Namespace for the Kubernetes service account"
type = string
default = "default"
}
variable "use_existing_k8s_sa" {
description = "Use an existing kubernetes service account instead of creating one"
type = bool
default = false
}
variable "annotate_k8s_sa" {
description = "Annotate the kubernetes service account with 'iam.gke.io/gcp-service-account' annotation. Valid in cases when an existing SA is used."
type = bool
default = true
}
variable "automount_service_account_token" {
description = "Enable automatic mounting of the service account token"
type = bool
default = false
}
variable "roles" {
description = "A list of roles to be added to the created service account"
type = list(string)
default = []
}
variable "impersonate_service_account" {
description = "An optional service account to impersonate for gcloud commands. If this service account is not specified, the module will use Application Default Credentials."
type = string
default = ""
}
variable "use_existing_context" {
description = "An optional flag to use local kubectl config context."
type = bool
default = false
}
variable "module_depends_on" {
description = "List of modules or resources to depend on before annotating KSA. If multiple, all items must be the same type."
type = list(any)
default = []
}
variable "additional_projects" {
description = "A list of roles to be added to the created service account for additional projects"
type = map(list(string))
default = {}
}
variable "gcp_sa_display_name" {
description = "The Google service account display name; if null, a default string will be used"
type = string
nullable = true
default = null
validation {
condition = var.gcp_sa_display_name == null ? true : length(var.gcp_sa_display_name) <= 100
error_message = "The Google service account display name must be at most 100 characters"
}
}
variable "gcp_sa_description" {
description = "The Service Google service account desciption; if null, will be left out"
type = string
nullable = true
default = null
validation {
condition = var.gcp_sa_description == null ? true : length(var.gcp_sa_description) <= 256
error_message = "The Google service account description must be at most 256 characters"
}
}