From a8c27b1b6e054c0f4f087f846f56925aa0c8a8d4 Mon Sep 17 00:00:00 2001 From: Natalia Strelkova Date: Thu, 20 Jul 2023 08:45:18 +0200 Subject: [PATCH] optional description in modules/net-vpc-swp --- modules/net-vpc-swp/README.md | 21 +++++++++++---------- modules/net-vpc-swp/main.tf | 9 +++++++-- modules/net-vpc-swp/variables.tf | 6 ++++++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/modules/net-vpc-swp/README.md b/modules/net-vpc-swp/README.md index 381d04eed..6107d90a1 100644 --- a/modules/net-vpc-swp/README.md +++ b/modules/net-vpc-swp/README.md @@ -171,17 +171,18 @@ module "secure-web-proxy" { |---|---|:---:|:---:|:---:| | [addresses](variables.tf#L19) | One or more IP addresses to be used for Secure Web Proxy. | | ✓ | | | [certificates](variables.tf#L27) | List of certificates to be used for Secure Web Proxy. | list(string) | ✓ | | -| [name](variables.tf#L44) | Name of the Secure Web Proxy resource. | string | ✓ | | -| [network](variables.tf#L49) | Name of the network the Secure Web Proxy is deployed into. | string | ✓ | | -| [project_id](variables.tf#L110) | Project id of the project that holds the network. | string | ✓ | | -| [region](variables.tf#L115) | Region where resources will be created. | string | ✓ | | -| [subnetwork](variables.tf#L126) | Name of the subnetwork the Secure Web Proxy is deployed into. | string | ✓ | | +| [name](variables.tf#L50) | Name of the Secure Web Proxy resource. | string | ✓ | | +| [network](variables.tf#L55) | Name of the network the Secure Web Proxy is deployed into. | string | ✓ | | +| [project_id](variables.tf#L116) | Project id of the project that holds the network. | string | ✓ | | +| [region](variables.tf#L121) | Region where resources will be created. | string | ✓ | | +| [subnetwork](variables.tf#L132) | Name of the subnetwork the Secure Web Proxy is deployed into. | string | ✓ | | | [delete_swg_autogen_router_on_destroy](variables.tf#L32) | Delete automatically provisioned Cloud Router on destroy. | bool | | true | -| [labels](variables.tf#L38) | Resource labels. | map(string) | | {} | -| [policy_rules](variables.tf#L54) | List of policy rule definitions, default to allow action. Available keys: secure_tags, url_lists, custom. URL lists that only have values set will be created. | object({…}) | | {} | -| [ports](variables.tf#L104) | Ports to use for Secure Web Proxy. | list(number) | | [443] | -| [scope](variables.tf#L120) | Scope determines how configuration across multiple Gateway instances are merged. | string | | null | -| [tls_inspection_config](variables.tf#L131) | TLS inspection configuration. | object({…}) | | null | +| [description](variables.tf#L38) | Optional description to add to created resources. | string | | "Managed by Terraform." | +| [labels](variables.tf#L44) | Resource labels. | map(string) | | {} | +| [policy_rules](variables.tf#L60) | List of policy rule definitions, default to allow action. Available keys: secure_tags, url_lists, custom. URL lists that only have values set will be created. | object({…}) | | {} | +| [ports](variables.tf#L110) | Ports to use for Secure Web Proxy. | list(number) | | [443] | +| [scope](variables.tf#L126) | Scope determines how configuration across multiple Gateway instances are merged. | string | | null | +| [tls_inspection_config](variables.tf#L137) | TLS inspection configuration. | object({…}) | | null | ## Outputs diff --git a/modules/net-vpc-swp/main.tf b/modules/net-vpc-swp/main.tf index 88b2fc743..92e8542b0 100644 --- a/modules/net-vpc-swp/main.tf +++ b/modules/net-vpc-swp/main.tf @@ -23,7 +23,7 @@ resource "google_network_security_gateway_security_policy" "policy" { project = var.project_id name = var.name location = var.region - description = "Managed by Terraform." + description = var.description tls_inspection_policy = var.tls_inspection_config != null ? google_network_security_tls_inspection_policy.tls-policy.0.id : null } @@ -33,6 +33,7 @@ resource "google_network_security_tls_inspection_policy" "tls-policy" { project = var.project_id name = var.name location = var.region + description = var.description ca_pool = var.tls_inspection_config.ca_pool exclude_public_ca_set = var.tls_inspection_config.exclude_public_ca_set } @@ -43,6 +44,7 @@ resource "google_network_security_gateway_security_policy_rule" "secure_tag_rule project = var.project_id name = each.key location = var.region + description = var.description gateway_security_policy = google_network_security_gateway_security_policy.policy.name enabled = each.value.enabled priority = each.value.priority @@ -61,7 +63,7 @@ resource "google_network_security_url_lists" "url_lists" { project = var.project_id name = each.key location = var.region - description = "Managed by Terraform." + description = var.description values = each.value.values } @@ -71,6 +73,7 @@ resource "google_network_security_gateway_security_policy_rule" "url_list_rules" project = var.project_id name = each.key location = var.region + description = var.description gateway_security_policy = google_network_security_gateway_security_policy.policy.name enabled = each.value.enabled priority = each.value.priority @@ -93,6 +96,7 @@ resource "google_network_security_gateway_security_policy_rule" "custom_rules" { provider = google-beta name = each.key location = var.region + description = var.description gateway_security_policy = google_network_security_gateway_security_policy.policy.name enabled = each.value.enabled priority = each.value.priority @@ -107,6 +111,7 @@ resource "google_network_services_gateway" "gateway" { project = var.project_id name = var.name location = var.region + description = var.description labels = var.labels addresses = var.addresses != null ? var.addresses : [] type = "SECURE_WEB_GATEWAY" diff --git a/modules/net-vpc-swp/variables.tf b/modules/net-vpc-swp/variables.tf index 5f540dc2f..085195b32 100644 --- a/modules/net-vpc-swp/variables.tf +++ b/modules/net-vpc-swp/variables.tf @@ -35,6 +35,12 @@ variable "delete_swg_autogen_router_on_destroy" { default = true } +variable "description" { + description = "Optional description to add to created resources." + type = string + default = "Managed by Terraform." +} + variable "labels" { description = "Resource labels." type = map(string)