-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Having annotations in google_cloud_run_domain_mapping forces deletion and recreation of the resource #7518
Comments
Cloud Run API (https://cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings/create) doesn't have an update method so |
the problem is that it recreates at every deploy without anything being updated in the module as long as it has annotations. |
Let's clarify: If should be possible to create a domain mapping with the In the reported issue, are you applying this terraform config from scratch? or are you applying it on an existing project? |
It has been applied in both instances and always results in recreation of the domain mapping. If creating the resource from scratch we need to use the beta flag or it fails, then we need to set annotations to null to avoid subsequent applys from recreating the mapping. |
We have the same problem. |
You should create the domain mapping with the annotation and never remove it afterwards. Attempting to create without the annotation or removing the annotation later leads to a failure because custom domains are a Beta Cloud Run feature. |
@steren I can confirm that your approach does not work. After creating the domain mapping with the annotation, on the next plan terraform wants to recreate it due to:
including the serving*-annotations on subsequent applies works (but does not make sense, since they are set implicitly on creation and change). Also, the described tactic of adding on create and then removing the annotation block completely for update runs works (as in the annotation is not removed, no change is done to the domain mapping). Therefore I think this is a valid issue and should be reopened. |
Confirming the same issue as @neurolabs, as workaround I've configure the following lifecycle policies
|
@emmekappa nice, I was trying to do ignoire_changes but could not get the syntax correct. How did you figure out |
It seems that problem come from the Wouldn't this be enough to fix domain mappings?
|
I opened #7583 to ignore the creator and lastModifier annotations by default |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform 0.13.3
Affected Resource(s)
google_cloud_run_domain_mapping
Terraform Configuration Files
Before change (with annotation)
After change(without annotation)
Expected Behavior
When this is run without change, no changes should be in the plan.
Actual Behavior
The terraform wants to destroy and recreate the domain mapping.
Steps to Reproduce
Important Factoids
N/A
References
N/A
The text was updated successfully, but these errors were encountered: