Skip to content

Commit

Permalink
Drop IAM resources from EkmConnection tests. (GoogleCloudPlatform#10407)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdbhacks authored and pcostell committed Jul 16, 2024
1 parent 93cbd73 commit 50a731d
Showing 1 changed file with 3 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ data "google_project" "vpc-project" {
}
data "google_project" "project" {
}
resource "google_project_iam_member" "add_sdviewer" {
project = data.google_project.vpc-project.number
role = "roles/servicedirectory.viewer"
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-ekms.iam.gserviceaccount.com"
}
resource "google_project_iam_member" "add_pscAuthorizedService" {
project = data.google_project.vpc-project.number
role = "roles/servicedirectory.pscAuthorizedService"
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-ekms.iam.gserviceaccount.com"
}
resource "google_kms_ekm_connection" "example-ekmconnection" {
name = "tf_test_ekmconnection_example%{random_suffix}"
location = "us-central1"
Expand All @@ -79,12 +69,8 @@ resource "google_kms_ekm_connection" "example-ekmconnection" {
hostname = data.google_secret_manager_secret_version.hostname.secret_data
server_certificates {
raw_der = data.google_secret_manager_secret_version.raw_der.secret_data
}
}
depends_on = [
google_project_iam_member.add_pscAuthorizedService,
google_project_iam_member.add_sdviewer
]
}
}
}
`, context)
}
Expand All @@ -108,16 +94,6 @@ data "google_secret_manager_secret_version" "servicedirectoryservice" {
secret = "external-servicedirectoryservice"
project = "315636579862"
}
resource "google_project_iam_member" "add_sdviewer_updateekmconnection" {
project = data.google_project.vpc-project.number
role = "roles/servicedirectory.viewer"
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-ekms.iam.gserviceaccount.com"
}
resource "google_project_iam_member" "add_pscAuthorizedService_updateekmconnection" {
project = data.google_project.vpc-project.number
role = "roles/servicedirectory.pscAuthorizedService"
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-ekms.iam.gserviceaccount.com"
}
resource "google_kms_ekm_connection" "example-ekmconnection" {
name = "tf_test_ekmconnection_example%{random_suffix}"
location = "us-central1"
Expand All @@ -128,12 +104,8 @@ resource "google_kms_ekm_connection" "example-ekmconnection" {
hostname = data.google_secret_manager_secret_version.hostname.secret_data
server_certificates {
raw_der = data.google_secret_manager_secret_version.raw_der.secret_data
}
}
}
depends_on = [
google_project_iam_member.add_pscAuthorizedService_updateekmconnection,
google_project_iam_member.add_sdviewer_updateekmconnection
]
}
`, context)
}

0 comments on commit 50a731d

Please sign in to comment.