-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
37 lines (33 loc) · 1.21 KB
/
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
29
30
31
32
33
34
35
36
37
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "6.9.0"
}
}
}
provider "google" {
impersonate_service_account = var.service_account_email
project = var.project_id
region = var.region
}
# Workload Identity Federation
resource "google_iam_workload_identity_pool" "main_pool" {
project = var.project_id
workload_identity_pool_id = var.pool_id
display_name = var.pool_display_name
description = var.pool_description
disabled = false
}
resource "google_iam_workload_identity_pool_provider" "main_provider" {
project = var.project_id
workload_identity_pool_id = google_iam_workload_identity_pool.main_pool.workload_identity_pool_id
workload_identity_pool_provider_id = var.provider_id
display_name = var.provider_display_name
description = var.provider_description
attribute_mapping = var.attribute_mapping
attribute_condition = var.attribute_condition
oidc {
issuer_uri = var.issuer_uri
}
}