33 oidc_github_idp = " token.actions.githubusercontent.com"
44
55 # compose the OIDC subject using opinionated set of claims
6- # TODO: discuss alternative with maintainers
7- # see 'claims_supported' for all possibilities (some of which would require custom GHA):
6+ # for alternatives with maintainers,see 'claims_supported' for
7+ # all possibilities (some of which would require custom GHA):
88 # https://token.actions.githubusercontent.com/.well-known/openid-configuration
99 ordered_claim_names = [
1010 " repo" , " environment" , " ref"
@@ -15,7 +15,9 @@ locals {
1515 var . github_repo , var . github_environment , var . github_branch
1616 ])
1717
18- # construct 'sub' claim parts by selecting non-empty arg values, then combine
18+ # construct 'sub' claim parts by selecting non-empty arg values, then
19+ # combine; these correspond to the source repo and branch, which
20+ # the GHA token issuer populates when sending requests to AWS
1921 claims = [
2022 for claim in local . ordered_claim_names : format (
2123 " %s:%s" ,
@@ -24,16 +26,9 @@ locals {
2426 ) if length (local. claims_with_values [claim ]) > 0
2527 ]
2628
27- oidc_gha_sub = join (" :" , var. allow_pull_request ? concat (
28- local. claims , [" pull_request" ]
29- ) : local. claims
30- )
31-
32- /*
33- Alternative, which would place more responsibility on user to specify valid OIDC claims:
34-
35- `oidc_expected_claims = join(":", [for k,v in var.claim_patterns : "${k}:${v}"])`
36- */
29+ # combine all component parts into a ':' delimited string for the
30+ # AWS policy to use for evaluating incoming request 'sub' claims
31+ oidc_gha_sub = join (" :" , local. claims )
3732
3833}
3934
0 commit comments