Skip to content
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

Peering names exceed limits when combined #2419

Closed
Beaverkilla opened this issue Jul 10, 2024 · 0 comments · Fixed by #2459
Closed

Peering names exceed limits when combined #2419

Beaverkilla opened this issue Jul 10, 2024 · 0 comments · Fixed by #2459

Comments

@Beaverkilla
Copy link

Beaverkilla commented Jul 10, 2024

Describe the bug
When the names of the local and peer network are combined, even excluding the optional prefix, the length of the names can exceed the allowed 63 character limit set within GCP. There is no option to override or truncate this when the limit is exceeded and as such some networks will never be able to be configured using the peering module.

I.e.
Local network name = "webcore-net1-atlas-web01-production"
Peering network name = "database-net1-apollo-production"
Prefix = null

Error: "name" ("webcore-net1-atlas-web01-production-database-net1-apollo-production") doesn't match regexp "^(?:a-z?)$"

Environment

Terraform v1.8.4
on windows_amd64
+ provider registry.terraform.io/hashicorp/google v5.33.0
+ provider registry.terraform.io/hashicorp/google-beta v5.33.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
6c06adb9

To Reproduce

  1. Create two networks with names exceeding 32 characters in length.
  2. Attempt to peer them via the net-vpc-peering module
  3. Witness error with no recourse

Expected behavior
The peering should be accepted with either a truncated name or the terraform should allow for an override name less than the 64 character limit.

Result

╷
│ Error: "name" ("webcore-net1-atlas-web01-production-database-net1-apollo-production") doesn't match regexp "^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$"
│
│   with module.peering["webcore-net1-atlas-web01-production"].google_compute_network_peering.local_network_peering,
│   on ..\cloud-foundation-fabric\modules\net-vpc-peering\main.tf line 24, in resource "google_compute_network_peering" "local_network_peering":
│   24:   name         = "${local.prefix}${local.local_network_name}-${local.peer_network_name}"
│
╵
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 a pull request may close this issue.

1 participant