-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Provider produced inconsistent result in bigquery_dataset_access #6175
Provider produced inconsistent result in bigquery_dataset_access #6175
Comments
If you see default roles are trying to be removed every time you apply, add the following block should help. Please close the issue if it works
|
I'm not sure what you mean @venkykuberan, the role bindings are being added with
The
|
I see the issue, role format being used is crashing the provider. Can you use the following format as per the doc
|
It worked @venkykuberan, I assume this is a legitimate bug in the tf provider, correct? Google's API docs mention that they accept both (and these uppercase, single-word variants are deprecated). |
Agreed, provider should handle it. I will keep this issue open and move it to code change bucket. Meantime using the Upper case role would get you going. Thank you for filing the issue |
From docs for
This isn't quite accurate, since it's showing a provider error instead of a diff - we created the object and attempt to read it from a list of access objects on the dataset. Since we have to identify access objects by its fields (i.e. I'm not sure how we want to resolve this - I think that when this resource was implemented, we wanted to avoid having hardcoded (predefined role X => primative Role Y) relationships in Terraform since that depends on the upstream BigQuery API behavior not changing (which it has as they add new roles). On the other hand, this appears as an error, which can't be overridden and definitely should be fixed. @farnoy I think the best workaround right now is to not use the predefined role ( |
If we reject predefined roles from here and not from the bigquery_dataset resource, then we have a weird inconsistency between the two. But if we reject predefined roles from there, it's a breaking change. I'd lean towards just hardcoding the mapping so we can have a consistent fix now instead of having to wait for 4.0.0, and maybe also safeguarding against the possibility of a new primitive role being added by checking for all-caps (though that seems like a pretty weird scenario) It's going to be a bit tricky to figure out what to write to state if we want to be mindful of #4328, but if it's not super obvious we can probably just wait until we actually need to fix that before we bother. |
Seeing the same behaviour with 'OWNER' role:
|
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 v0.12.24
Affected Resource(s)
Terraform Configuration Files
Debug Output
I don't feel comfortable pasting the whole thing, here's a snippet:
Panic Output
No panic
Expected Behavior
Permissions were created, terraform state was saved.
Actual Behavior
Permissions were created and are visible in the Cloud Console, but terraform fails to save the new state and will try to create them again on every
apply
.Steps to Reproduce
private
in Cloud Console$ terraform import google_bigquery_dataset.private_dataset projects/xxx/datasets/private
$ terraform apply
Important Factoids
Authenticating as a user through gcloud SDK, not sure if creating a dataset from the UI has any effect compared to creating the same dataset with terraform.
References
The text was updated successfully, but these errors were encountered: