File tree Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 1
1
locals {
2
- tfc_workload_identity_workspaces_exact = flatten ([
2
+ tfc_workload_identity_workspaces = flatten ([
3
3
for org , workspaces in var . tfc_workload_identity_workspaces : [
4
- for workspace in workspaces : [
5
- " organization:${ org } :workspace:${ workspace } :run_phase:plan" ,
6
- " organization:${ org } :workspace:${ workspace } :run_phase:apply" ,
7
- ] if ! can (regex (" \\ *+" , workspace))
8
- ]
9
- ])
10
- tfc_workload_identity_workspaces_wildcard = flatten ([
11
- for org , workspaces in var . tfc_workload_identity_workspaces : [
12
- for workspace in workspaces : " organization:${ org } :workspace:${ workspace } :run_phase:*" if can (regex (" \\ *+" , workspace))
4
+ for workspace in workspaces : " organization:${ org } :workspace:${ workspace } :run_phase:*"
13
5
]
14
6
])
15
7
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module "tfc_workload_identity_role" {
15
15
# Role must not be created if no workspaces are listed. Otherwise, anyone on TFC with the right
16
16
# audience can assume this role.
17
17
create_role = var. create_tfc_workload_identity_role && (
18
- length (local. tfc_workload_identity_workspaces_exact ) + length (local . tfc_workload_identity_workspaces_wildcard ) > 0
18
+ length (local. tfc_workload_identity_workspaces ) > 0
19
19
)
20
20
21
21
role_name = var. tfc_workload_identity_role
@@ -29,8 +29,7 @@ module "tfc_workload_identity_role" {
29
29
30
30
provider_url = var. create_tfc_oidc_provider ? aws_iam_openid_connect_provider. tfc_provider [0 ]. url : local. oidc_provider_url
31
31
32
- oidc_fully_qualified_subjects = local. tfc_workload_identity_workspaces_exact
33
- oidc_subjects_with_wildcards = local. tfc_workload_identity_workspaces_wildcard
32
+ oidc_subjects_with_wildcards = local. tfc_workload_identity_workspaces
34
33
oidc_fully_qualified_audiences = try (coalescelist (var. tfc_workload_identity_role_audiences , aws_iam_openid_connect_provider. tfc_provider [0 ]. client_id_list ), [])
35
34
36
35
tags = var. tags
Original file line number Diff line number Diff line change @@ -10,8 +10,5 @@ output "tfc_workload_identity_audience" {
10
10
11
11
output "tfc_workload_identity_workspaces" {
12
12
description = " Workspaces allowed to assume the Workload Identity IAM Role"
13
- value = concat (
14
- local. tfc_workload_identity_workspaces_exact ,
15
- local. tfc_workload_identity_workspaces_wildcard ,
16
- )
13
+ value = local. tfc_workload_identity_workspaces
17
14
}
You can’t perform that action at this time.
0 commit comments