- Newest
- Most votes
- Most comments
Based on the information provided, you're encountering an "Invalid principal in policy" error when trying to create an IAM role for the Amazon Selling Partner API (SP-API). This is a common issue that can occur for a few specific reasons.
First, it's important to understand that the error message suggests there's an issue with the principal element in your trust policy. When creating IAM roles, the principal element specifies who is allowed to assume the role.
Looking at your attempts, there are a couple of potential issues:
-
For the Selling Partner API, there appears to be confusion about the correct service principal to use. Based on a similar issue reported by others, there might be a discrepancy between "sellingpartner.amazonaws.com" and "sellingpartnerap1.amazon.com" (note the "i" not "1" in "api").
-
When using the AWS account principal method, ensure that you're formatting the JSON correctly. The error message showing "AWS":"arn:aws:iam::490152333827:root" suggests there might be an issue with the JSON syntax or formatting.
Here are some troubleshooting steps you can try:
-
Double-check the JSON syntax in your trust policy. Make sure there are no extra spaces, quotes, or other formatting issues.
-
Try using the correct service principal for SP-API. Based on community reports, you might want to try "sellingpartnerapi.amazon.com" (with an "i" not a "1").
-
When using the IAM visual editor, make sure you're selecting the correct trusted entity type and entering the account ID correctly.
-
If you're copying and pasting the policy, try manually typing it instead to avoid any hidden characters or formatting issues.
If you continue to face issues, it might be worth waiting for a response to your support case, as they can provide account-specific guidance. While there are some restrictions on new AWS accounts, they typically don't prevent creating trust relationships with specific AWS services in this manner.
Sources
Invalid principal in policy" when creating SP-API role – Despite correct "Service": "sellingpartner.amazonaws.com | AWS re:Post
IAM policy validation check reference - AWS Identity and Access Management
AWS re:Post Knowledge Center Spotlight: AWS Identity and Access Management (IAM) | AWS re:Post
IAM Error: Invalid principal 'SERVICE':'polly.amazonaws.com' in Role Trust Policy & S3 Bucket Policy (Multi-Region) | AWS re:Post
answered a year ago
The error message means that the AWS account whose ID you specified doesn't exist or has been suspended or closed. Which document are you looking at?
Relevant content
asked 3 months ago
asked 3 years ago
