Skip to content

Commit

Permalink
feat: Add a description variable for google_compute_global_address re…
Browse files Browse the repository at this point in the history
…source (#299)

* Add an ability to set description

* Remove empty line

* Document description input
  • Loading branch information
kpocius authored May 9, 2022
1 parent 2734f71 commit fe91aa5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/private_service_access/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ that are connected to the same VPC.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| address | First IP address of the IP range to allocate to CLoud SQL instances and other Private Service Access services. If not set, GCP will pick a valid one for you. | `string` | `""` | no |
| description | An optional description of the Global Address resource. | `string` | `""` | no |
| ip\_version | IP Version for the allocation. Can be IPV4 or IPV6. | `string` | `""` | no |
| labels | The key/value labels for the IP range allocated to the peered network. | `map(string)` | `{}` | no |
| prefix\_length | Prefix length of the IP range reserved for Cloud SQL instances and other Private Service Access services. Defaults to /16. | `number` | `16` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/private_service_access/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
data "google_compute_network" "main" {
name = var.vpc_network
project = var.project_id

}

// We define a VPC peering subnet that will be peered with the
Expand All @@ -28,6 +27,7 @@ resource "google_compute_global_address" "google-managed-services-range" {
provider = google-beta
project = var.project_id
name = "google-managed-services-${var.vpc_network}"
description = var.description
purpose = "VPC_PEERING"
address = var.address
prefix_length = var.prefix_length
Expand Down
6 changes: 6 additions & 0 deletions modules/private_service_access/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ variable "address" {
default = ""
}

variable "description" {
description = "An optional description of the Global Address resource."
type = string
default = ""
}

variable "prefix_length" {
description = "Prefix length of the IP range reserved for Cloud SQL instances and other Private Service Access services. Defaults to /16."
type = number
Expand Down

0 comments on commit fe91aa5

Please sign in to comment.