Hello,
I’ve created a dataset on GCP using the Terraform resource google_bigquery_dataset.
On the GCP console, I can see some permissions were given but I don’t know where do they come from.
So, I’ve inspected the Terraform state, and I can see these permissions in the access list of the google_bigquery_dataset resource :
“module”: “module.MY_MODULE”,
“mode”: “managed”,
“type”: “google_bigquery_dataset”,
“name”: “dataset”,
“provider”: “provider["registry.terraform.io/hashicorp/google"]”,
“instances”: [
{
“schema_version”: 0,
“attributes”: {
“access”: [
{
“dataset”: ,
“domain”: “”,
“group_by_email”: “”,
“iam_member”: “My_User_1”,
“role”: “My_Role_1”,
“routine”: ,
“special_group”: “”,
“user_by_email”: “”,
“view”:
},
{
“dataset”: ,
“domain”: “”,
“group_by_email”: “”,
“iam_member”: “My_User_2”,
“role”: “My_Role_2”,
“routine”: ,
“special_group”: “”,
“user_by_email”: “”,
“view”:
}
…
I’ve tried to remove the block containing My_User_2 from the state and push it back (to keep only permissions of My_User_1).
When I try to run a new plan on the workspace, it’s detecting a drift in the dataset :
{“@ level”:“info”,“@ message”:“module.MY_MODULE.google_bigquery_dataset.dataset: Drift detected (update)”,“@ module”:“terraform.ui”,“@timestamp”:“2024-12-16T13:59:15.236917Z”,“change”:{“resource”:{“addr”:“module.MY_MODULE.google_bigquery_dataset.dataset”,“module”:“module.MY_DATASET”,“resource”:“google_bigquery_dataset.dataset”,“implied_provider”:“google”,“resource_type”:“google_bigquery_dataset”,“resource_name”:“dataset”,“resource_key”:null},“action”:“update”},“type”:“resource_drift”}
But in the end it’s not making any changes to the resource :
{“@ level”:“info”,“@ message”:“Plan: 0 to add, 0 to change, 0 to destroy.”,“@module”:“terraform.ui”,“@ timestamp”:“2024-12-16T13:59:15.237064Z”,“changes”:{“add”:0,“change”:0,“remove”:0,“operation”:“plan”},“type”:“change_summary”}
I was expecting Terraform to change the resource in order to remove the permission on GCP.
Am I wrong or am I missing something ?
Thank you in advance,
Regards