-
Notifications
You must be signed in to change notification settings - Fork 724
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
[UX] Project ID collision handling #451
Comments
Unfortunately there isn't any way for us to do this. It's core Terraform behavior. |
reopening to include some sample commands on how to taint and recover in the troubleshooting docs |
Trying to understand what needs to be documented. Is it the case that if the user gets the listed error message, they should delete the project name from .tfstate and try running terraform again? |
IMO instruction should be given to temporarily
Tension is inherent between the goal of having a black box GitOps interface for customers that doesn't require Terraform expertise, and the likelihood that at some point an escape hatch will be required. For cases like this it will be useful to explain how to temporarily break out of the GitOps workflow and wire up Terraform to remote state for targeted, resource-level operations. |
Any update on this? Whilst rehearsing the deployment of landing zones with the CFT - my team has experienced this issue multiple times. Ideally the modules building out projects, would be updated to use a larger range of "random Id's" but i realise there are many different modules which would need the same issue remediation. Could all the layers instead have an extra random id inserted into the project name template (before the module's are called?) for example: prj-c-dns-hub-c98c becomes prj-c-dns-hub-7bfe-c98c This should then hopefully avoid the opportunity for the same "unique" project name to be generated twice, obviously there is a probability but a much lesser one than currently |
@bharathkkb - are you still planning to work on this? |
@daniel-cit once terraform-google-modules/terraform-google-project-factory#742 lands lets update project factory everywhere to use new approach added in terraform-google-modules/terraform-google-project-factory#735 which should reduce this from happening |
@bharathkkb - Is this work still happening? Thanks! |
Deploying with Cloud Build
Issue
When Project creation fails with
Error 409: Requested entity already exists, alreadyExists
the randomized Project ID is written to .tfstate in"provider[\"registry.terraform.io/hashicorp/random\"]"
and even though Project creation fails, the Project ID is recorded in .tfstateoutputs
Workaround
To resolve the Project ID collision the .tfstate must be modified to remove the object created by the hashicorp/random provider
Enhancement ideas
The text was updated successfully, but these errors were encountered: