Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add jwt_condition option to oidc variable for IAM trust relationships #608

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws-assume-role-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data "aws_iam_policy_document" "assume-role" {
actions = ["sts:AssumeRoleWithWebIdentity", "sts:TagSession"]
condition {
test = "StringEquals"
variable = "${oidc.value["provider"]}:aud"
variable = "${oidc.value["provider"]}:${oidc.value["jwt_condition"]}"
values = oidc.value["client_ids"]
}
}
Expand Down
7 changes: 4 additions & 3 deletions aws-assume-role-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ variable "saml_idp_arns" {
variable "oidc" {
type = list(object(
{
idp_arn : string, # the AWS IAM IDP arn
client_ids : list(string), # a list of oidc client ids
provider : string # your provider url, such as foo.okta.com
idp_arn : string, # the AWS IAM IDP arn
client_ids : list(string), # a list of oidc client ids
provider : string, # your provider url, such as foo.okta.com
jwt_condition: optional(string, "aud") # the condition to allow the JWT token
}
))
default = []
Expand Down
3 changes: 3 additions & 0 deletions aws-assume-role-policy/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1.3.0"
}
3 changes: 2 additions & 1 deletion aws-iam-role-crossacct/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ variable "oidc" {
{
idp_arn : string, # the AWS IAM IDP arn
client_ids : list(string), # a list of oidc client ids
provider : string # your provider url, such as foo.okta.com
provider : string, # your provider url, such as foo.okta.com
jwt_condition: string # the condition to allow the JWT token
}
))

Expand Down
3 changes: 3 additions & 0 deletions aws-iam-role-crossacct/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1.3.0"
}
Loading