Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Error 400: Invalid value for field 'resource.name' #101

Open
miro-ka opened this issue Oct 19, 2018 · 1 comment
Open

Error 400: Invalid value for field 'resource.name' #101

miro-ka opened this issue Oct 19, 2018 · 1 comment

Comments

@miro-ka
Copy link

miro-ka commented Oct 19, 2018

Keep getting following:

  • google_compute_route.gke-master-default-gw: Error creating Route: googleapi: Error 400: Invalid value for field 'resource.name': 'gke-europe-west1-env-prod-n1s1--d03266a0-gke-5f502db9-node-master-default-gw-1'. Must be a match of regex '(?:a-z?)', invalid

Terraform v0.11.8
provider.google v1.19.1
provider.null v1.0.0
provider.template v1.0.0

@fs-wnelson
Copy link

fs-wnelson commented Dec 6, 2018

I ran into this too. The problem is the route's name has a 61 character limit.

What I did was changed the line

name = "${var.gke_node_tag}-master-default-gw-${count.index + 1}"

in the file terraform-google-nat-gateway/examples/gke-nat-gateway/main.tf

You have to either manually change this value here up to the -${count.index +1} or abbreviate the master-default-gw, which is what I did.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants