terraform-provider-google
                                
                                 terraform-provider-google copied to clipboard
                                
                                    terraform-provider-google copied to clipboard
                            
                            
                            
                        google_bigquery_dataset_access can't be imported
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
The google_bigquery_dataset_access resource does not support importing an existing configuration. If you try and apply a terraform description containing this resource, and the target dataset already has a matching permission already defined (not created by terraform), then the apply fails.
Error: Unable to create DatasetAccess, existing object already found: map[role:OWNER userByEmail:[email protected]]
  on main.tf line 256, in resource "google_bigquery_dataset_access" "my_service_account":
 256: resource "google_bigquery_dataset_access" "my_service_account" {
Relevant section from the terraform description
resource "google_bigquery_dataset_access" "my_service_account" {
  dataset_id = "my_bg_dataset"
  role = "OWNER"
  user_by_email  = "[email protected]"
}
New or Affected Resource(s)
- google_bigquery_dataset_access
Potential Terraform Configuration
# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.
References
- #0000
b/361572871
This needs to be retriaged. The resource doesn't support import today.
I think this is essentially a dupe of https://github.com/hashicorp/terraform-provider-google/issues/7486.
I have the same issue.
@rileykarson it looks like you had previously triaged this as documentation - is the issue that we need to document the fact that it can't be imported, as opposed to implementing import?
Not sure, sorry! May have just clicked the wrong button. It already states it can't be imported: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigquery_dataset_access#import