-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
98 lines (82 loc) · 4.28 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
# ---------------------------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# These variables must be set when using this module.
# ---------------------------------------------------------------------------------------------------------------------
variable "project_id" {
type = string
description = "(Required) The project ID. Changing this forces a new project to be created."
}
# ---------------------------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# These variables have defaults, but may be overridden.
# ---------------------------------------------------------------------------------------------------------------------
variable "name" {
type = string
description = "(Optional) The display name of the project. Defaults to project_id."
default = null
}
variable "iam" {
type = any
description = "(Optional) List of IAM roles and members to set for the created project."
default = []
}
variable "org_id" {
type = string
description = "(Optional) The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization."
default = null
}
variable "folder_id" {
type = string
description = "(Optional) The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder."
default = null
}
variable "billing_account" {
type = string
description = "(Optional) The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with Terraform must have at mininum Billing Account User privileges (roles/billing.user) on the billing account."
default = null
}
variable "skip_delete" {
type = bool
description = "(Optional) If true, the Terraform resource can be deleted without deleting the Project via the Google API."
default = false
}
variable "labels" {
type = map(string)
description = "(Optional) A set of key/value label pairs to assign to the project."
default = {}
}
variable "auto_create_network" {
type = bool
description = <<-END
(Optional)
Create the 'default' network automatically.
If kept false, the default network will be deleted.
Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
It is recommended to use the constraints/compute.skipDefaultNetworkCreation constraint to remove the default network instead of setting auto_create_network to false.
END
default = false
}
variable "computed_members_map" {
type = map(string)
description = "(Optional) A map of members to replace in 'members' to handle terraform computed values. Will be ignored when policy bindings are used."
default = {}
validation {
condition = alltrue([for k, v in var.computed_members_map : can(regex("^(user|serviceAccount|group|domain):", v))])
error_message = "The value must be a non-empty string being a valid principal type prefixed with `user:`, `serviceAccount:`, `group:` or `domain:`."
}
}
# ------------------------------------------------------------------------------
# MODULE CONFIGURATION PARAMETERS
# These variables are used to configure the module.
# See https://medium.com/mineiros/the-ultimate-guide-on-how-to-write-terraform-modules-part-1-81f86d31f024
# ------------------------------------------------------------------------------
variable "module_enabled" {
type = bool
description = "(Optional) Whether to create resources within the module or not."
default = true
}
variable "module_depends_on" {
type = any
description = "(Optional) A list of external resources the module depends_on."
default = []
}