Guest User

Untitled

a guest
Sep 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. account_ids = [
  2. "111111111111",
  3. "222222222222"
  4. ]
  5.  
  6. data "aws_iam_policy_document" "sf-automation-switch-role" {
  7. statement {
  8. effect = "Allow"
  9. actions = ["sts:AssumeRole"]
  10. # resources = ["${data.template_file.account_ids.*.rendered}"]
  11. }
  12. }
  13.  
  14. data "template_file" "account_ids" {
  15. count = "${length(var.account_ids)}"
  16. # need to double-escape template variables
  17. # We need this list to have " ", therefore it is escaped.
  18. template = ""arn:aws::$${account_id}:role/$${assumed-automation-role}""
  19. vars {
  20. account_id = "${var.account_ids[count.index]}"
  21. assumed-automation-role = "${var.assumed-automation-role}"
  22. }
  23. }
  24.  
  25. ""arn:aws::111111111:role/sf-automation-id""
Add Comment
Please, Sign In to add comment