-
Notifications
You must be signed in to change notification settings - Fork 71
fix: make sure subnet is uniquely named #61
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
Conversation
|
SummaryWe are using the However, we are for the first time running into a problem in conjunction with This PR's change works fine on my local instance because I have the random_id already computed in my local terraform state. It fails with clean terraform state. As I noted below, we have some workarounds, but this doesn't seem like it should be a unique problem for this solution. Underlying resource: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_subnetwork |
|
After not finding similar issues in GitHub repos associated with the module or terraform provider, I tried running it myself and didn't find this error. Going to re-run the test on the assumption this failure was a flake. |
|
The test failed again. I found this excellent explanation: https://stackoverflow.com/a/70192949. I see two paths forward based on information so far:
|
|
From further discussion, the recommended path is to remove the network module in favor of directly using the google_compute_subnetwork resource, because we're only creating a single subnet the module doesn't benefit us much, but the indirection and for_each it introduces prevents using random_id. |
I'll use this same PR, but rework to this suggestion. |
Resolves #60