Skip to content

Conversation

@amrkk123
Copy link
Contributor

No description provided.

@amrkk123 amrkk123 requested review from a team, ayushmjain, imrannayer and q2w as code owners July 23, 2025 12:25
Copy link
Collaborator

@q2w q2w left a comment

Choose a reason for hiding this comment

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

Thanks!

  • please validate the service_uri format being introduced here.
  • please validate if changing the neg name would not trigger delete/create.

}

output "apphub_service_uri" {
value = {
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 keep this list of object like it is in regional LB?

output "apphub_service_uri" {
value = {
service_uri = "//compute.googleapis.com/${google_compute_forwarding_rule.default[0].id}"
service_id = substr("${google_compute_forwarding_rule.default[0].name}-${md5("global-${var.project_id}")}", 0, 63)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
service_id = substr("${google_compute_forwarding_rule.default[0].name}-${md5("global-${var.project_id}")}", 0, 63)
service_id = substr("${google_compute_forwarding_rule.default[0].name}-${md5("global-lb-${var.project_id}")}", 0, 63)

}

output "apphub_service_uri" {
value = {
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 keep this as list of object. I see you already have the type in metadata.yaml as list of object.

output "apphub_service_uri" {
value = {
service_uri = "//compute.googleapis.com/${google_compute_backend_service.default[0].id}"
service_id = substr("${google_compute_backend_service.default[0].name}-${md5("global-${var.project_id}")}", 0, 63)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
service_id = substr("${google_compute_backend_service.default[0].name}-${md5("global-${var.project_id}")}", 0, 63)
service_id = substr("${google_compute_backend_service.default[0].name}-${md5("global-be-service-${var.project_id}")}", 0, 63)

for_each = toset(var.serverless_neg_backends)
content {
group = google_compute_region_network_endpoint_group.serverless_negs["neg-${var.name}-${backend.value.service_name}-${backend.value.region}"].id
group = google_compute_region_network_endpoint_group.serverless_negs["neg-${var.name}-${substr(sha256(backend.value.service_name), 0, 4)}-${backend.value.region}"].id
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
group = google_compute_region_network_endpoint_group.serverless_negs["neg-${var.name}-${substr(sha256(backend.value.service_name), 0, 4)}-${backend.value.region}"].id
group = google_compute_region_network_endpoint_group.serverless_negs["neg-${var.name}-${backend.value.region}-${substr(md5(backend.value.service_name), 0, 4)}"].id

Copy link
Collaborator

Choose a reason for hiding this comment

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

You would need to change NEG resource name similarly.

@q2w q2w changed the title fix: Adding regex validation for service name and adding apphub fix!: Adding regex validation for service name and adding apphub Jul 30, 2025
@q2w
Copy link
Collaborator

q2w commented Jul 30, 2025

Marking this a breaking change as it updates serverless_negs name within modules/backend. this would trigger delete/create behavior.

@q2w q2w enabled auto-merge (squash) July 30, 2025 09:59
auto-merge was automatically disabled July 30, 2025 10:28

Head branch was pushed to by a user without write access

@q2w q2w enabled auto-merge (squash) July 30, 2025 11:54
@q2w q2w merged commit 687152d into terraform-google-modules:main Jul 30, 2025
4 checks passed
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