Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
update pks iam roles to keep them consistent with pks documents servi…
Browse files Browse the repository at this point in the history
…ce accounts required roles
  • Loading branch information
oahcran authored and ciphercules committed Mar 20, 2019
1 parent 482560b commit 7322250
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
15 changes: 11 additions & 4 deletions modules/ops_manager/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@ resource "google_service_account_key" "opsman_service_account_key" {
service_account_id = "${google_service_account.opsman_service_account.id}"
}

resource "google_project_iam_member" "opsman_iam_service_account_actor" {
resource "google_project_iam_member" "opsman_iam_service_account_user" {
count = "${var.create_iam_service_account_members}"
project = "${var.project}"
role = "roles/iam.serviceAccountActor"
role = "roles/iam.serviceAccountUser"
member = "serviceAccount:${google_service_account.opsman_service_account.email}"
}

resource "google_project_iam_member" "opsman_compute_instance_admin" {
resource "google_project_iam_member" "opsman_iam_service_account_token_creator" {
count = "${var.create_iam_service_account_members}"
project = "${var.project}"
role = "roles/compute.instanceAdmin"
role = "roles/iam.serviceAccountTokenCreator"
member = "serviceAccount:${google_service_account.opsman_service_account.email}"
}

resource "google_project_iam_member" "opsman_compute_instance_admin_v1" {
count = "${var.create_iam_service_account_members}"
project = "${var.project}"
role = "roles/compute.instanceAdmin.v1"
member = "serviceAccount:${google_service_account.opsman_service_account.email}"
}

Expand Down
14 changes: 10 additions & 4 deletions modules/pks/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ resource "google_service_account_key" "pks_worker_node_service_account_key" {
service_account_id = "${google_service_account.pks_worker_node_service_account.id}"
}

resource "google_project_iam_member" "pks_master_node_compute_instance_admin" {
resource "google_project_iam_member" "pks_master_node_compute_instance_admin_v1" {
project = "${var.project}"
role = "roles/compute.instanceAdmin"
role = "roles/compute.instanceAdmin.v1"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}

Expand All @@ -40,9 +40,15 @@ resource "google_project_iam_member" "pks_master_node_compute_security_admin" {
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}

resource "google_project_iam_member" "pks_master_node_iam_service_account_actor" {
resource "google_project_iam_member" "pks_master_node_iam_service_account_user" {
project = "${var.project}"
role = "roles/iam.serviceAccountActor"
role = "roles/iam.serviceAccountUser"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}

resource "google_project_iam_member" "pks_master_node_compute_viewer" {
project = "${var.project}"
role = "roles/compute.viewer"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}

Expand Down

0 comments on commit 7322250

Please sign in to comment.