Skip to content

Commit 48bcee6

Browse files
Bo98apeabody
andauthored
feat(TPG>=5.2)!: support labelling regional IPs (#116)
Co-authored-by: Andrew Peabody <[email protected]>
1 parent 0c04c42 commit 48bcee6

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Terraform may change this fact, but this is the current limitation.
195195
| enable\_reverse\_dns | If a value is set, register reverse DNS PTR records in Cloud DNS in the managed zone specified by dns\_reverse\_zone | `bool` | `false` | no |
196196
| global | The scope in which the address should live. If set to true, the IP address will be globally scoped. Defaults to false, i.e. regionally scoped. When set to true, do not provide a subnetwork. | `bool` | `false` | no |
197197
| ip\_version | The IP Version that will be used by this address. | `string` | `"IPV4"` | no |
198+
| labels | Labels to apply to this address. | `map(string)` | `{}` | no |
198199
| names | A list of IP address resource names to create. This is the GCP resource name and not the associated hostname of the IP address. Existing resource names may be found with `gcloud compute addresses list` (e.g. ["gusw1-dev-fooapp-fe-0001-a-001-ip"]) | `list(string)` | `[]` | no |
199200
| network\_tier | The networking tier used for configuring this address. | `string` | `"PREMIUM"` | no |
200201
| prefix\_length | The prefix length of the IP range. | `number` | `16` | no |
@@ -219,7 +220,7 @@ Terraform may change this fact, but this is the current limitation.
219220
## Requirements
220221
### Terraform plugins
221222
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
222-
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin v1.12.0
223+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin >= 5.2.0
223224

224225
### Configure a Service Account
225226
In order to execute this module you must have a Service Account with the following roles:

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ resource "google_compute_address" "ip" {
5757
address_type = var.address_type
5858
purpose = var.address_type == "INTERNAL" ? var.purpose : null
5959
network_tier = var.address_type == "INTERNAL" ? null : var.network_tier
60+
labels = var.labels
6061
}
6162

6263
resource "google_compute_global_address" "global_ip" {

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,9 @@ variable "ip_version" {
131131
description = "The IP Version that will be used by this address."
132132
default = "IPV4"
133133
}
134+
135+
variable "labels" {
136+
type = map(string)
137+
description = "Labels to apply to this address."
138+
default = {}
139+
}

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 3.53, < 6"
23+
version = ">= 5.2, < 6"
2424
}
2525
}
2626

0 commit comments

Comments
 (0)