Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- account_ids = [
- "111111111111",
- "222222222222"
- ]
- data "aws_iam_policy_document" "sf-automation-switch-role" {
- statement {
- effect = "Allow"
- actions = ["sts:AssumeRole"]
- # resources = ["${data.template_file.account_ids.*.rendered}"]
- }
- }
- data "template_file" "account_ids" {
- count = "${length(var.account_ids)}"
- # need to double-escape template variables
- # We need this list to have " ", therefore it is escaped.
- template = ""arn:aws::$${account_id}:role/$${assumed-automation-role}""
- vars {
- account_id = "${var.account_ids[count.index]}"
- assumed-automation-role = "${var.assumed-automation-role}"
- }
- }
- ""arn:aws::111111111:role/sf-automation-id""
Add Comment
Please, Sign In to add comment