Skip to content

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 a team, ayushmjain, imrannayer and q2w 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


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


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