bigquery iam permissions not updatable
See original GitHub issueI have an existing environment which I’ve created and managed via Deployment Manager, including a BigQuery dataset and several tables.
A requirement came up where I needed a new service account which needed permissions on the BigQuery dataset, so I added the service account and adjusted the dataset’s accessControl policy in my jinja template.
resources:
#...
- name: my_dataset
type: bigquery.v2.dataset
accessControl:
gcpIamPolicy:
bindings:
- role: 'roles/bigquery.dataOwner'
members:
- "serviceAccount:polyglot-sync@{{ properties["project"] }}.iam.gserviceaccount.com"
- role: 'roles/bigquery.jobUser'
members:
- "serviceAccount:polyglot-sync@{{ properties["project"] }}.iam.gserviceaccount.com"
#...
The service account created successfully, but I received an error when DM tried to deploy the new accessControl policy:
- code: NO_METHOD_TO_UPDATE_ACCESS_CONTROL
location: /deployments/sre-staging-17/resources/my_dataset
message: No method found to update access control on resource 'my_dataset' of type
'bigquery.v2.dataset'.
Surely accessControl policies will always be subject to change? Having them non-updatable seems unbelievable. Have I just misunderstood something, or is there another way to achieve this please?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Control access to resources with IAM | BigQuery - Google Cloud
Go to the BigQuery page. Go to BigQuery. In the Explorer pane, expand your project and select a dataset. Click person_add Sharing >...
Read more >User does not have bigquery.datasets.update permission
I was able to fix this by creating a new key with the role Project - Owner, rather than BigQuery - Reader.
Read more >BigQuery IAM Management 101: Defining Permissions ...
Understanding BigQuery IAM Role Types · Predefined Roles: The Google Cloud Access tokens provide granular access to a specific service and are ...
Read more >BigQuery Admin - Permissions Reference for Google Cloud IAM
Action Based On Access Level
bigquery.bireservations.get bigquery.bireservations.get Read
bigquery.bireservations.update bigquery.bireservations.update Write
bigquery.capacityCommitments.create bigquery.capacityCommitments.create Write
Read more >How to set up Google BigQuery - Atlan
datasets.getIamPolicy allows Atlan to read a data set's IAM permissions. bigquery.jobs.create allows Atlan to run jobs (including queries) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve tested your scenario with the
gcp-types/bigquery-v2:datasetstype and update or permissions works fine.I would also highlight the Cloud Foundation Toolkit templates for Bigquery Dataset and Table: https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/tree/master/dm/templates/bigquery
Usinf the CFT Dataset template:
Please let me know if this solved your issue!
The lack of email verification makes sense, thanks for the explanation!
The docs do say:
I interpreted this to mean you can pass in valid roles such as
roles/bigquery.jobUser, but just don’t expect it to return this in the same output. I am puzzled why the IAM here would only support what is referred to as “legacy” permissions and not actual role names; but assume this will change as DM evolves?I made a change to reduce my access entry to just:
However
bq showstill shows onlyprojectReaders,projectWritersandprojectOwners, suggesting it still hasn’t assigned the permissions correctly.I do appreciate you saying the python examples work, but would really like to get the vanilla yaml working here before adding further complexity into our approach.