-
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
google_iap_brand does not work #6100
Comments
Hey @minac Can you include debug logs for the run where terraform fails to create the brand when the project does not have a brand already? The debug logs that you included are from a run where the brand already exists, and this fails in an expected way. When a specific resource already exists but terraform does not know about it, terraform will attempt to create it, which causes the 409 conflict failure. You may want to import the existing brand rather than attempting to create it again: https://www.terraform.io/docs/import/index.html |
Hey Sam. I no longer have the debug session and logs, I’m afraid. The
listing of operations showed the creation of all the other objects (like a
GKE cluster), but not the brand. Then when I try to run again it says that
the brand has already been created.
The import fails as well. The docs mention a {{ name }} to import, but one
must use the full project path. And then it fails to import in the same way
as the creation.
These two are simple to reproduce with what I sent.
I hope this helps
On Tue, 14 Apr 2020 at 18:54, Sam Levenick ***@***.***> wrote:
Hey @minac <https://github.com/minac>
Can you include debug logs for the run where terraform fails to create the
brand when the project does not have a brand already?
The debug logs that you included are from a run where the brand already
exists, and this fails in an expected way. When a specific resource already
exists but terraform does not know about it, terraform will attempt to
create it, which causes the 409 conflict failure.
You may want to import the existing brand rather than attempting to create
it again: https://www.terraform.io/docs/import/index.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGMVBVT4PRKQP6VWMVHUSDRMSPLTANCNFSM4MGMKQTA>
.
--
Miguel David
|
Hmm, I'm able to import a brand. I'd note that the format of {{name}} is documented here: https://www.terraform.io/docs/providers/google/r/iap_brand.html#name So the import command would look something like: I would note that running terraform destroy causes terraform to think it destroyed the iap_brand, but it doesn't actually delete the brand because there is no support for deleting these resources from the API side. So after a successful create you will need to use |
Importing an existing brand (particular one that wasn't created by Terraform) succeeds, however I think this behavior makes a problem:
Let's say you want to change the
This is getting the What's interesting to me here is, that Terraform works probably correct on the surface but runs into a limitation of the Google API. In particular
So whats interesting to me is, that it destroys rather than changing it in place. From the note above it is obvious that a destroy won't really destroy and then you run into the exact conflict that terraform ops out even before it creates/changes the resource because it is already there (conflict with Shouldn't we change the behavior here that changes to the object won't force replacement which leads us down to |
Ah, ok I see the issue. When the Also see: https://cloud.google.com/iap/docs/programmatic-oauth-clients?#branding Unfortunately this is not fixable via Terraform, although I will add a note to the brand resource about it being unable to be deleted. If you want the ability to update and delete brands, feel free to file a feature request on the Identity-Aware proxy issue tracker here: https://cloud.google.com/support/docs/issue-trackers |
Filed the feature request https://issuetracker.google.com/issues/154652489 |
closing this issue as the work is the tracked in feature request. |
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 👉 hashibot-feedback@hashicorp.com. 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 v0.12.24
Affected Resource(s)
There is no data source yet.
Terraform Configuration Files
Debug Output
https://gist.github.com/minac/3eca9d579f501beda7e4507471ef5be0
Panic Output
N/A
Expected Behavior
The IAP brand would either be created or accept the existing one and move on.
Actual Behavior
The IAP brand was not marked created in the first run (although it was), and when I added the IAP client it attempts to create the brand and fails because it's already there.
Steps to Reproduce
terraform apply
Important Factoids
I tried this with a project that already had a brand created (which cannot be undone, even on Google console side). And then tried it with a fresh project with no brand created.
References
The text was updated successfully, but these errors were encountered: