Skip to content

Commit

Permalink
Fix TestAccSqlUser_postgresIAM by using an IAM user that actually exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Mitchell committed May 21, 2024
1 parent 430f650 commit e2f57c6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mmv1/third_party/terraform/services/sql/resource_sql_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func TestAccSqlUser_postgres(t *testing.T) {
}

func TestAccSqlUser_postgresIAM(t *testing.T) {
t.Skipf("Skipping test %s due to https://github.com/hashicorp/terraform-provider-google/issues/16704", t.Name())
t.Parallel()

instance := fmt.Sprintf("tf-test-%d", acctest.RandInt(t))
Expand Down Expand Up @@ -428,9 +427,17 @@ resource "time_sleep" "wait_30_seconds" {
create_duration = "30s"
}
data "google_project" "project" {}
resource "google_project_iam_member" "iam_user" {
project = data.google_project.project.project_id
role = "roles/cloudsql.instanceUser"
member = "user:[email protected]"
}
resource "google_sql_user" "user" {
depends_on = [time_sleep.wait_30_seconds]
name = "admin"
depends_on = [time_sleep.wait_30_seconds, google_project_iam_member.iam_user]
name = "admin@hashicorptest.com"
instance = google_sql_database_instance.instance.name
type = "CLOUD_IAM_USER"
}
Expand Down

0 comments on commit e2f57c6

Please sign in to comment.