-
Notifications
You must be signed in to change notification settings - Fork 0
/
psk-gcp-platform-vpc-sa.tf
41 lines (37 loc) · 1.39 KB
/
psk-gcp-platform-vpc-sa.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
resource "google_service_account" "vpc" {
account_id = "psk-gcp-platform-vpc-sa"
display_name = "Service Account to manage VPCs and subnets"
}
module "vpc-role" {
source = "terraform-google-modules/iam/google//modules/custom_role_iam"
#checkov:skip=CKV_TF_1
version = "7.7.0"
target_level = "project"
target_id = var.gcp_project_id
role_id = "pskGcpPlatformVpcRole"
title = "PSK GCP Platform VPC Role"
description = "Role used by terraform to manage VPCs and Subnets"
base_roles = [
"roles/compute.networkAdmin",
]
permissions = []
excluded_permissions = [
"networksecurity.firewallEndpoints.create",
"networksecurity.firewallEndpoints.delete",
"networksecurity.firewallEndpoints.get",
"networksecurity.firewallEndpoints.list",
"networksecurity.firewallEndpoints.update",
"networksecurity.firewallEndpoints.use",
"resourcemanager.projects.list"
]
members = ["serviceAccount:psk-gcp-platform-vpc-sa@${var.gcp_project_id}.iam.gserviceaccount.com"]
depends_on = [google_service_account.vpc]
}
resource "google_service_account_iam_binding" "vpc" {
service_account_id = google_service_account.vpc.name
role = "roles/iam.serviceAccountTokenCreator"
members = [
"serviceAccount:psk-gcp-platform-base-sa@${var.gcp_state_project_id}.iam.gserviceaccount.com",
"group:[email protected]"
]
}