Closed oprudkyi closed 11 months ago
found workaround via postcondition , seems it distinguishes db without permissions and non exists db
data "google_spanner_database_iam_policy" "spanner_database_data" {
database = var.database
project = var.project
instance = var.instance
lifecycle {
postcondition {
condition = self.etag != null
error_message = "Spanner database not found. Database : projects/${var.project}/instances/${var.instance}/databases/${var.database}, member : ${var.member}"
}
}
}
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.6.4 on linux_amd64
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
error - database not found
Actual Behavior
everything fine like db is exists
Steps to Reproduce
terraform plan
Important Factoids
since this is xy problem in reality I want to add permissions to different entities via google_spanner_database_iam_member current behavior - plan is successful but apply fails since resource not found I want to check if the resource exists on plan stage alternative solution can be dummy data.google_spanner_database just to validate existence
References
0000