-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
82 lines (68 loc) · 3.82 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
# ----------------------------------------------------------------------------------------------------------------------
# REQUIRED PARAMETERS
# These variables must be set when using this module.
# ---------------------------------------------------------------------------------------------------------------------
variable "service" {
description = "(Required) The service name for IAM binding/member/policy to be attached to."
type = string
}
variable "location" {
description = "(Required) The service location for IAM binding/member/policy to be attached to."
type = string
}
# ----------------------------------------------------------------------------------------------------------------------
# OPTIONAL PARAMETERS
# These variables have defaults, but may be overridden.
# ---------------------------------------------------------------------------------------------------------------------
variable "members" {
type = set(string)
description = "(Optional) Identities that will be granted the privilege in role for. Each entry can have one of the following values: `allUsers`, `allAuthenticatedUsers`, `serviceAccount:{emailid}`, `user:{emailid}`, `group:{emailid}`, `domain:{domain}`, `projectOwner:projectid`, `projectEditor:projectid`, `projectViewer:projectid`."
default = []
validation {
condition = alltrue([for m in var.members : can(regex("^(allUsers|allAuthenticatedUsers|(user|serviceAccount|group|domain|projectOwner|projectEditor|projectViewer|computed):)", m))])
error_message = "The value must be a non-empty list of strings where each entry is a valid principal type identified with `allUsers`, `allAuthenticatedUsers` or prefixed with `user:`, `serviceAccount:`, `group:`, `domain:`, `projectOwner:`, `projectEditor:`, `projectViewer:` or `computed`."
}
}
variable "computed_members_map" {
type = map(string)
description = "(Optional) A map of members to replace in `var.members` or in members of `policy_bindings` to handle terraform computed values."
default = {}
validation {
condition = alltrue([for k, v in var.computed_members_map : can(regex("^(allUsers|allAuthenticatedUsers|(user|serviceAccount|group|domain|projectOwner|projectEditor|projectViewer):)", v))])
error_message = "The value must be a non-empty string being a valid principal type identified with ``allUsers`, `allAuthenticatedUsers` or prefixed with `user:`, `serviceAccount:`, `group:`, `domain:`, `projectOwner:`, `projectEditor:` or `projectViewer:`."
}
}
variable "role" {
description = "(Optional) The role that should be applied. Note that custom roles must be of the format `[projects|organizations]/{parent-name}/roles/{role-name}`."
type = string
default = null
}
variable "project" {
description = "(Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used."
type = string
default = null
}
variable "authoritative" {
description = "(Optional) Whether to exclusively set (authoritative mode) or add (non-authoritative/additive mode) members to the role."
type = bool
default = true
}
variable "policy_bindings" {
description = "(Optional) A list of IAM policy bindings to apply to a created secret."
type = any
default = null
}
# ------------------------------------------------------------------------------
# MODULE CONFIGURATION PARAMETERS
# These variables are used to configure the module.
# ------------------------------------------------------------------------------
variable "module_enabled" {
type = bool
description = "(Optional) Toggle resource creation within the module."
default = true
}
variable "module_depends_on" {
type = any
description = "(Optional) A list of external resources the module depends_on."
default = []
}