hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Location is not consistently being imported for bigquery transfer config #15733

Open obada-ab opened 1 year ago

obada-ab commented 1 year ago

Community Note

Terraform Version

Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v4.80.0

Affected Resource(s)

Terraform command

terraform import google_bigquery_data_transfer_config.query_config projects/XX/transferConfigs/YY

Where YY is a transfer config ID, and XX is the number of the project containing this transfer config.

Expected Behavior

The file terraform.tfstate should have the location as follows:

            "email_preferences": [],
            "id": "projects/XX/transferConfigs/YY",
            "location": "US",
            "name": "projects/XX/locations/us/transferConfigs/YY",

Actual Behavior

            "email_preferences": [],
            "id": "projects/XX/transferConfigs/YY",
            "location": null,
            "name": "projects/XX/locations/us/transferConfigs/YY",

References

obada-ab commented 1 year ago

As mentioned in https://github.com/GoogleCloudPlatform/magic-modules/pull/8768#issuecomment-1701188442, the location is assumed to be US when I use the GET endpoint for the name format that doesn't contain location. However, I wasn't able to find this information documented anywhere, so It might be better to verify this.

edwardmedia commented 1 year ago

b/299267592