- Newest
- Most votes
- Most comments
This error occurs when AWS Amplify is unable to assume the IAM role specified for your deployment. To resolve this issue, you need to check several aspects of your IAM configuration:
- Verify the trust relationship policy of the IAM role you're using for Amplify. The trust policy should include both the regional Amplify service and the general Amplify service. Your trust policy should look similar to:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": ["amplify.YOUR-REGION.amazonaws.com", "amplify.amazonaws.com"]
},
"Action": "sts:AssumeRole"
}
]
}
-
Ensure that the IAM role has the necessary permissions attached. Typically, roles used with Amplify should have policies like AdministratorAccess and AdministratorAccess-Amplify.
-
Check for any inline policies that might be restricting access.
-
Verify that all AWS resources related to your Amplify app are in the same region.
-
Review your CloudTrail logs for any denied API calls related to AssumeRole actions.
-
Ensure that the IAM user or role you're using has permission to call
sts:AssumeRolefor the role that Amplify needs to assume.
This issue can sometimes occur even if configurations appear correct, especially after recent changes to your application or AWS environment. If the problem persists after checking these items, you might need to invalidate the cache or deploy a fresh version of the app.
Sources
Unable to Assume IAM Role in AWS Amplify Deployment | AWS re:Post
on amplify react app deploy issue | AWS re:Post
"mcurrent credentials could not be used to assume *** role" error during amolify deployment | AWS re:Post
Troubleshoot IAM roles - AWS Identity and Access Management
The error is about why amplify cannot assume the role and it's not referring to your user permissions. Agreed with repost's solution around trust policy.
My Amplify build/deployments were failing with the error message "Unable to assume specified IAM Role". The issue was the AWS Amplify Github App lost access to my Amplify Project's GitHub Repository.
My Fix: In GitHub Org, go to Settings > GitHub Apps > AWS Amplify and choose Configure. Review the settings in the section Repository Access. In my case, I had to re-add the repository.
answered a year ago
Relevant content
asked 2 years ago
asked a year ago
asked a year ago
