Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add resource_manager_tags to module and use it on google_compute_instance_from_template. #344

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/compute_instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ See the [simple](https://github.com/terraform-google-modules/terraform-google-vm
| network | Network to deploy to. Only one of network or subnetwork should be specified. | `string` | `""` | no |
| num\_instances | Number of instances to create. This value is ignored if static\_ips is provided. | `number` | `"1"` | no |
| region | Region where the instances should be created. | `string` | `null` | no |
| resource\_manager\_tags | (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource. | `map(string)` | `null` | no |
| resource\_policies | (Optional) A list of short names or 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 |
| static\_ips | List of static IPs for VM instances | `list(string)` | `[]` | no |
| subnetwork | Subnet to deploy to. Only one of network or subnetwork should be specified. | `string` | `""` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/compute_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ resource "google_compute_instance_from_template" "compute_instance" {
resource_policies = var.resource_policies
labels = var.labels

params {
resource_manager_tags = var.resource_manager_tags
}

dynamic "network_interface" {
for_each = local.network_interface

Expand Down
6 changes: 6 additions & 0 deletions modules/compute_instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,9 @@ variable "labels" {
description = "(Optional) Labels to override those from the template, provided as a map"
default = null
}

variable "resource_manager_tags" {
description = "(Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource."
type = map(string)
default = null
}