I am trying to create different boundary policies for dev, staging and production restricting each to specific regions. For dev, we’re restricting to “eu-north-1”. I am using a federated user to login and test this, but I am getting errors, and am unsure where I am going wrong.
Dev, for example, I created a role with the following test boundary policy attached :
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyAllOutsideRequestedRegions",
"Effect": "Deny",
"NotAction": [
"cloudfront:*",
"iam:*",
"route53:*",
"support:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": [
"eu-north-1"
]
}
}
}
]
}
I added a test inline policy to the role as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:*",
"ec2:*"
],
"Resource": "*"
}
]
}
The trust relationship is as follows:
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Effect”: “Allow”,
“Principal”: {
“AWS”: “arn:aws:iam::<ACCOUNT_ID>:root”
},
“Action”: “sts:AssumeRole”,
“Condition”: {}
}
]
}
I then switch to that role and attempt to go to the IAM dashboard but see API errors :
User: arn:aws:sts::<ACCOUNT_ID>:assumed-role/test-boundary-role/<USER_ID> is not authorized to perform: iam:GetAccountSummary on resource: * because no permissions boundary allows the iam:GetAccountSummary action
What am I missing here?