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 condition_operator field to allow overriding StringEquals with StringLike #610

Merged
Show file tree
Hide file tree
Changes from all 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 @@ -52,7 +52,7 @@ data "aws_iam_policy_document" "assume-role" {

actions = ["sts:AssumeRoleWithWebIdentity", "sts:TagSession"]
condition {
test = "StringEquals"
test = "${oidc.value["condition_operator"]}"
variable = "${oidc.value["provider"]}:${oidc.value["jwt_condition"]}"
values = oidc.value["client_ids"]
}
Expand Down
9 changes: 5 additions & 4 deletions aws-assume-role-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ 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
jwt_condition: optional(string, "aud") # the condition to allow the JWT token
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
condition_operator : optional(string, "StringEquals"), # the condition operator for the iam statement
}
))
default = []
Expand Down
9 changes: 5 additions & 4 deletions aws-iam-role-crossacct/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ variable "source_role_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
jwt_condition: optional(string) # the condition to allow the JWT token
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), # the condition to allow the JWT token
condition_operator : optional(string), # the condition operator for the iam statement
}
))

Expand Down
Loading