Skip to content

Commit

Permalink
feat: add source role arns
Browse files Browse the repository at this point in the history
  • Loading branch information
abiju-czi committed Sep 19, 2022
1 parent 793bbcc commit a96bc38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions aws-assume-role-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ data "aws_iam_policy_document" "assume-role" {
}
}

dynamic "statement" {
for_each = var.source_role_arns
content {
principals {
type = "AWS"
identifiers = [statement.value]
}
actions = ["sts:AssumeRole", "sts:TagSession"]
}
}

dynamic "statement" {
for_each = var.saml_idp_arns

Expand Down
5 changes: 5 additions & 0 deletions aws-assume-role-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ variable "source_account_ids" {
description = "The source AWS account IDs to establish a trust relationship. Ignored if empty or not provided."
}

variable "source_role_arns" {
type = list(string)
description = "The source AWS roles to establish a trust relationship. Ignored if empty or not provided."
}

variable "saml_idp_arns" {
type = set(string)
default = []
Expand Down

0 comments on commit a96bc38

Please sign in to comment.