You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/instance_template/README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
21
21
| automatic\_restart | (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). |`bool`|`true`| no |
22
22
| can\_ip\_forward | Enable IP forwarding, for NAT instances for example |`string`|`"false"`| no |
23
23
| confidential\_instance\_type | Defines the confidential computing technology the instance uses. If this is set to "SEV\_SNP", var.min\_cpu\_platform will be automatically set to "AMD Milan". See https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#confidential_instance_type.|`string`|`null`| no |
24
+
| create\_service\_account | Create a new service account to attach to the instance. This is alternate to providing the service\_account input variable. Please provide the service\_account input if setting this to false! |`bool`|`true`| no |
24
25
| description | The template's description |`string`|`""`| no |
25
26
| disk\_encryption\_key | The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance |`string`|`null`| no |
26
27
| disk\_labels | Labels to be assigned to boot disk, provided as a map |`map(string)`|`{}`| no |
@@ -47,7 +48,8 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
47
48
| project\_id | The GCP project ID |`string`| n/a | yes |
48
49
| region | Region where the instance template should be created. |`string`| n/a | yes |
49
50
| resource\_policies | A list of self\_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. |`list(string)`|`[]`| no |
50
-
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account.| <pre>object({<br> email = string<br> scopes = optional(set(string), ["cloud-platform"])<br> })</pre> | n/a | yes |
51
+
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account.| <pre>object({<br> email = string<br> scopes = optional(set(string), ["cloud-platform"])<br> })</pre> |`null`| no |
52
+
| service\_account\_project\_roles | Roles to grant to the newly created cloud run SA in specified project. Should be used with create\_service\_account set to true and no input for service\_account |`list(string)`|`[]`| no |
51
53
| shielded\_instance\_config | Not used unless enable\_shielded\_vm is true. Shielded VM configuration for the instance. | <pre>object({<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> enable_integrity_monitoring = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
52
54
| source\_image | Source disk image. If neither source\_image nor source\_image\_family is specified, defaults to the latest public Rocky Linux 9 optimized for GCP image. |`string`|`""`| no |
53
55
| source\_image\_family | Source image family. If neither source\_image nor source\_image\_family is specified, defaults to the latest public Rocky Linux 9 optimized for GCP image. |`string`|`"rocky-linux-9-optimized-gcp"`| no |
@@ -69,6 +71,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
69
71
| name | Name of instance template |
70
72
| self\_link | Self-link of instance template |
71
73
| self\_link\_unique | Unique self-link of instance template (recommended output to use instead of self\_link) |
74
+
| service\_account\_info | Service account id and email |
72
75
| tags | Tags that will be associated with instance(s) |
description: Create a new service account to attach to the instance. This is alternate to providing the service_account input variable. Please provide the service_account input if setting this to false!
306
+
varType: bool
307
+
defaultValue: true
308
+
- name: service_account_project_roles
309
+
description: Roles to grant to the newly created cloud run SA in specified project. Should be used with create_service_account set to true and no input for service_account
310
+
varType: list(string)
311
+
defaultValue: []
303
312
- name: enable_shielded_vm
304
313
description: Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images
305
314
varType: bool
@@ -365,6 +374,8 @@ spec:
365
374
- name: self_link_unique
366
375
description: Unique self-link of instance template (recommended output to use instead of self_link)
367
376
type: string
377
+
- name: service_account_info
378
+
description: Service account id and email
368
379
- name: tags
369
380
description: Tags that will be associated with instance(s)
Copy file name to clipboardExpand all lines: modules/instance_template/variables.tf
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -328,6 +328,19 @@ variable "service_account" {
328
328
scopes =optional(set(string), ["cloud-platform"])
329
329
})
330
330
description="Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account."
331
+
default=null
332
+
}
333
+
334
+
variable"create_service_account" {
335
+
type=bool
336
+
description="Create a new service account to attach to the instance. This is alternate to providing the service_account input variable. Please provide the service_account input if setting this to false!"
337
+
default=true
338
+
}
339
+
340
+
variable"service_account_project_roles" {
341
+
type=list(string)
342
+
description="Roles to grant to the newly created cloud run SA in specified project. Should be used with create_service_account set to true and no input for service_account"
0 commit comments