-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
28 lines (25 loc) · 847 Bytes
/
main.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
provider "google" {
credentials = var.google_credentials
project = var.project_name
region = var.region
zone = var.zone
}
resource "google_compute_address" "vault-ip" {
name = local.vault_ip_name
region = var.region
project = var.project_name
}
# Add the service account to the project
resource "google_project_iam_member" "service-account" {
count = length(var.service_account_iam_roles)
project = var.project_name
role = var.service_account_iam_roles[count.index]
member = local.service_account_with_email
}
# Add user-specified roles
resource "google_project_iam_member" "service-account-custom" {
count = length(var.service_account_custom_iam_roles)
project = var.project_name
role = var.service_account_custom_iam_roles[count.index]
member = local.service_account_with_email
}