Skip to content

Commit 7fbe719

Browse files
committed
feat(blog-article): PR feedback -- IAM trust policy with AWS SSO roles
1 parent bf52273 commit 7fbe719

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

content/blog/fix-iam-trust-policy-errors-with-aws-sso-regional-arn.md renamed to content/blog/fix-iam-trust-policy-errors-using-aws-sso-regional-arn.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
visible: true
33
draft: false
4-
title: "Fixing IAM Trust Policy Errors when using AWS IAM Identity Center SSO Role (Regional ARN, us-east-1 vs other regions)"
4+
title: "Fix IAM Trust Policy Errors using AWS IAM Identity Center SSO Role Regional ARN"
55
author: Yangci Ou
66
slug: fix-iam-trust-policy-errors-with-aws-sso-regional-arn
77
date: 2025-09-17
@@ -16,7 +16,7 @@ You set up a trust policy that looks correct, references the correct SSO role AR
1616

1717
It might be because of this critical gotcha edge case: region-specific paths in the SSO role ARNs.
1818

19-
I faced this issue myself, along with others on [StackOverflow](https://stackoverflow.com/questions/73639007/allow-user-to-assume-an-iam-role-with-sso-login), [AWS re:Post](https://repost.aws/questions/QUpP-HDDmXT4C1YvjWvoVl_A/aws-identity-center-assumed-role-principals), and even [Reddit](https://www.reddit.com/r/aws/comments/1ml4zjn/trusting_external_customers_aws_idenitity_center/). It's buried in the [AWS documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/referencingpermissionsets.html) and easy to miss, so I'll cover it in this article to hopefully help others avoid scratching their heads for an hour like I did, and make it easily findable on the Internet.
19+
I faced this issue myself, along with others on [StackOverflow](https://stackoverflow.com/questions/73639007/allow-user-to-assume-an-iam-role-with-sso-login), [AWS re:Post](https://repost.aws/questions/QUpP-HDDmXT4C1YvjWvoVl_A/aws-identity-center-assumed-role-principals), and even [Reddit](https://www.reddit.com/r/aws/comments/1ml4zjn/trusting_external_customers_aws_idenitity_center/). When pairing with my colleague, Veronika, we asked ChatGPT to troubleshoot this, but even it was unable to provide the correct solution. It's a small but important piece of information that's buried in the [AWS documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/referencingpermissionsets.html) and easy to miss, so I'll cover it in this article to hopefully help others avoid scratching their heads for an hour like I did, and make it easily findable on the Internet.
2020

2121
## The Problem
2222

@@ -143,8 +143,12 @@ Here's an example IAM trust policy that allows SSO users from the Administrator
143143
"Condition": {
144144
"ArnLike": {
145145
"aws:PrincipalArn": [
146-
// Instead of us-west-2, you can also use * to allow any region.
147-
// The wildcard (*) at the end of the ARN AWSReservedSSO_AWSAdministratorAccess* is also important, as there's no need to hardcode the randomly generated ID.
146+
// It's worth noting that if Disaster Recovery (multi-region) is a priority
147+
// or when using IaC such as Terraform, instead of hardcoding the region like us-west-2,
148+
// it may be better to use `/*/` (which doesn't impose any security risks either).
149+
150+
// The wildcard (*) at the end of the ARN AWSReservedSSO_AWSAdministratorAccess* is
151+
// also important, as there's no need to hardcode the randomly generated ID.
148152
"arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/us-west-2/AWSReservedSSO_AWSAdministratorAccess*"
149153
]
150154
}
@@ -175,7 +179,10 @@ data "aws_iam_policy_document" "assume_role_policy" {
175179
test = "ArnLike"
176180
variable = "aws:PrincipalArn"
177181
values = [
178-
# Instead of us-west-2, you can also use * to allow any region.
182+
# It's worth noting that if Disaster Recovery (multi-region) is a priority
183+
# or when using IaC such as Terraform, instead of hardcoding the region like us-west-2,
184+
# it may be better to use `/*/` (which doesn't impose any security risks either).
185+
179186
# The wildcard (*) at the end of the ARN AWSReservedSSO_AWSAdministratorAccess* is also important,
180187
# as there's no need to hardcode the randomly generated ID.
181188
"arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/us-west-2/AWSReservedSSO_AWSAdministratorAccess*"

0 commit comments

Comments
 (0)