Open NemanjaMilenkovic opened 4 months ago
Hi @NemanjaMilenkovic!
I'm reviewing this scenario, but I saw that you have a lot of different versions:
unexpected diff on google provider update from 4.65.0 to > 5.0.0
Terraform Version & Provider Version(s)
you put cdktf 0.17.2 on provider registry.terraform.io/hashicorp/google v5.21.0
Steps to reproduce
you put use google provider version < 5.0.0
and update google provider version to >=5.0.0
Could you please be clear on which terraform version
and Google provider version
are you using? And if you are using a particular terraform code for the resources google_bigquery_connection_iam_member
and google_bigquery_dataset_iam_member
because you are only sharing a map without more context
Hi @ggtisc!
This would be an example of cdktf used that would cause it: (any google_bigquery_dataset_iam_member resource would should produce same result, there )
readonly connectionExample = new google.bigqueryConnectionIamMember.BigqueryConnectionIamMember(
this,
`connection-exampleId-exampleType-examplePrincipalId`,
{
connectionId: `projects/exampleProject/locations/exampleLocation/connections/exampleConnectionId`,
role: 'roles/bigquery.connectionUser',
member: `serviceAccount:${principal.email}`,
location: 'exampleLocation',
}
);
Terraform HCL equivalent would be something like:
resource "google_bigquery_dataset_iam_member" "user" {
dataset_id = 'projects/exampleProject/locations/exampleLocation/connections/exampleConnectionId'
role = 'roles/bigquery.connectionUser'
member = 'serviceAccount:${principal.email}'
}
I see the cause being Terraform Data Source, used for google_bigquery_dataset_iam_member.member - this can be avoided with a workaround of using local values (indirectly referencing the managed resource values through a local value). More info about data source dependencies: https://developer.hashicorp.com/terraform/language/data-sources#data-resource-dependencies
Main question here is - why is this happening on Google provider update from major version 4 to Google provider update to major version 5.
I tried to replicate this issue following your specifications, but the result was No changes. Your infrastructure matches your configuration.
The 1st thing I noticed is that you are using variables in your code like:
I suggest you check your code configuration related to your variables 1 by 1 to see if any are changing its value at compilation, run or execution time.
Finally the code used to replicate this scenario is here.
Community Note
Terraform Version & Provider Version(s)
cdktf 0.17.2 on
Affected Resource(s)
Terraform Configuration
Debug Output
(not relevant data redacted with "...")
Expected Behavior
no change
Actual Behavior
unexpeced diff on connection_id and force change on member
Steps to reproduce
terraform apply
Important Factoids
No response
References
No response