Skip to content

feat: added support for creating proxy only subnet #501

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pawan1210
Copy link
Contributor

@pawan1210 pawan1210 commented Apr 14, 2025

  • Updated the "internal_forwarding_rules_config" variable by adding two new keys.
  • This will now support creation of proxy only subnets for INTERNAL_MANAGED LBs.
  • For INTERNAL_SELF_MANAGED and global EXTERNAL_MANAGED type LB we don't need proxy only subnets.

@pawan1210 pawan1210 force-pushed the feat/create-proxy-only-subnet branch from d4fba67 to e97f914 Compare April 14, 2025 18:28
@pawan1210 pawan1210 marked this pull request as ready for review April 14, 2025 18:51
@pawan1210 pawan1210 requested review from ayushmjain, imrannayer, q2w and a team as code owners April 14, 2025 18:51
region = string
address = optional(string)
subnetwork = optional(string)
create_proxy_only_subnet = bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a default value for this as false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -200,11 +200,13 @@ variable "http_keep_alive_timeout_sec" {
}

variable "internal_forwarding_rules_config" {
description = "List of internal managed forwarding rules config. One of 'address' or 'subnetwork' is required for each. It is only applicable for internal load balancer"
description = "List of internal managed forwarding rules config. One of 'address' or 'subnetwork' is required for each. If 'create_proxy_only_subnet' is true, 'proxy_only_subnet_ip' is required. It is only applicable for internal load balancer."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned here one of address and subnetwork can be configured. Can we have a validation block for this input variable to validate exactly this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@pawan1210
Copy link
Contributor Author

/gcbrun

@@ -43,6 +43,22 @@ locals {
first_backend_service = try(local.backend_services_by_host[local.first_host][local.first_path], null)
}

resource "google_compute_subnetwork" "proxy_only" {
for_each = {
for index, config in var.internal_forwarding_rules_config : index => config
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use region as key to remove risk of recreation because of order change? This is similar to how it has been done when creating forwarding rules for internal_forwarding_rules_config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@pawan1210 pawan1210 force-pushed the feat/create-proxy-only-subnet branch from 8b7114b to 7355458 Compare April 21, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants