Jan 19, 2022

AWS IAM Assume Roles Based on Tags

0
0
{{ }} Substitute variables

Adjust the variable values according to your preference.

Policy Code

1{
2    "Version": "2012-10-17",
3    "Statement": [
4        {
5            "Sid": "AssumeTaggedRole",
6            "Effect": "Allow",
7            "Action": "sts:AssumeRole",
8            "Resource": "*",
9            "Condition": {
10                "StringEquals": {"iam:ResourceTag/{{tagName}}": "{{tagValue}}"}
11            }
12        }
13    ]
14}
DOC

Specify the key/value pair for the condition to match by substituting the {{tagName}} and {{tagValue}} variables.

    Get the IAM Pulse Check Newsletter

    We send out a periodic newsletter full of tips & tricks, contributions from the community, commentary on the industry, relevant social posts, and more.

    Checkout past issues for a sampling of the goods.