Skip to content

Commit

Permalink
add iam to test
Browse files Browse the repository at this point in the history
  • Loading branch information
danawillow committed May 23, 2018
1 parent 8ee3359 commit 8587aff
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions google/resource_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,28 @@ resource "google_compute_shared_vpc_service_project" "service_project" {
service_project = "${google_project_service.service_project.project}"
}
resource "google_project_iam_member" "host_service_agent" {
project = "${google_project_service.host_project.project}"
role = "roles/container.hostServiceAgentUser"
member = "serviceAccount:service-${google_project.service_project.number}@container-engine-robot.iam.gserviceaccount.com"
depends_on = ["google_project_service.service_project"]
}
resource "google_subnetwork_iam_member" "service_network_cloud_services" {
project = "${google_compute_shared_vpc_host_project.host_project.project}"
subnetwork = "${google_compute_subnetwork.shared_subnetwork.name}"
role = "roles/compute.networkUser"
member = "serviceAccount:${google_project.service_project.number}@cloudservices.gserviceaccount.com"
}
resource "google_subnetwork_iam_member" "service_network_gke_user" {
project = "${google_compute_shared_vpc_host_project.host_project.project}"
subnetwork = "${google_compute_subnetwork.shared_subnetwork.name}"
role = "roles/compute.networkUser"
member = "serviceAccount:service-${google_project.service_project.number}@container-engine-robot.iam.gserviceaccount.com"
}
resource "google_compute_network" "shared_network" {
name = "test-%s"
project = "${google_compute_shared_vpc_host_project.host_project.project}"
Expand Down Expand Up @@ -2199,5 +2221,11 @@ resource "google_container_cluster" "shared_vpc_cluster" {
cluster_secondary_range_name = "${google_compute_subnetwork.shared_subnetwork.secondary_ip_range.0.range_name}"
services_secondary_range_name = "${google_compute_subnetwork.shared_subnetwork.secondary_ip_range.1.range_name}"
}
depends_on = [
"google_project_iam_member.host_service_agent",
"google_project_iam_member.service_network_cloud_services",
"google_project_iam_member.service_network_gke_user"
]
}`, projectName, org, billingId, projectName, org, billingId, acctest.RandString(10), acctest.RandString(10), name)
}

0 comments on commit 8587aff

Please sign in to comment.