-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-auth-jwt.tf
39 lines (37 loc) · 935 Bytes
/
02-auth-jwt.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
resource "vault_jwt_auth_backend" "gsuite" {
path = "jwt"
oidc_discovery_url = "https://accounts.google.com"
bound_issuer = "https://accounts.google.com"
default_role = "default"
}
resource "vault_jwt_auth_backend_role" "admin" {
backend = vault_jwt_auth_backend.gsuite.path
role_type = "jwt"
role_name = "admin"
user_claim = "email"
bound_audiences = [
"32555940559.apps.googleusercontent.com"
]
bound_claims = {
email = "[email protected]"
}
token_policies = [
vault_policy.policies["admin.hcl"].name,
vault_policy.policies["ci.hcl"].name
]
}
resource "vault_jwt_auth_backend_role" "ci" {
backend = vault_jwt_auth_backend.gsuite.path
role_type = "jwt"
role_name = "ci"
user_claim = "email"
bound_audiences = [
"vault/ci"
]
bound_claims = {
email = local.ci_gsa
}
token_policies = [
vault_policy.policies["ci.hcl"].name
]
}