AWS API Gateway error API Gateway does not have permission to assume the provided role as S3 proxy
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
This error usually means API Gateway was given an IAM role ARN for the integration, but the role either does not trust API Gateway or does not have the right permissions once assumed. In an S3 proxy setup, both pieces matter: API Gateway must be allowed to assume the role, and the assumed role must be allowed to access the target bucket objects.
What API Gateway Is Trying to Do
For an AWS service integration to S3, API Gateway can use a credentials role. At runtime it tries to assume that role and then call S3 on your behalf.
If the assume-role step fails, you get the error before S3 permissions are even evaluated.
Fix the Trust Relationship First
The IAM role used by the integration must trust the API Gateway service principal.
If that trust policy is missing or wrong, API Gateway cannot assume the role no matter what S3 permissions you attach later.
Then Attach the S3 Permissions
Once the trust policy is correct, the same role still needs permission to perform the actual S3 action required by the integration.
Change the action and resource to match your use case, such as PutObject for uploads.
Verify the Role ARN in the Integration
A perfectly configured role still will not help if API Gateway points to the wrong ARN. Double-check the credentials field in the integration settings or IaC definition.
For example, in CloudFormation or OpenAPI-backed definitions, make sure the integration credentials value is the exact role ARN you intended.
Bucket Policy Can Still Matter
If the bucket policy is restrictive, the assumed role may still be blocked even after a successful assume-role step. That produces a different kind of failure, but it is worth checking if the trust relationship looks correct and the error evolves into an S3 access problem.
In other words:
- trust policy controls whether API Gateway can assume the role
- IAM permissions and bucket policy control what the assumed role can do in S3
Redeploy After Changes
API Gateway deployments often require an explicit redeploy before configuration changes take effect. If you fix the IAM role and still see the old error immediately, confirm that the API stage was redeployed.
This is a common source of confusion during iterative debugging.
Common Pitfalls
- Adding S3 permissions without fixing the trust relationship first does not solve the assume-role failure.
- Using the wrong service principal in the trust policy prevents API Gateway from assuming the role.
- Pointing the integration at the wrong role ARN makes the configuration look correct in IAM but wrong in API Gateway.
- Forgetting bucket-policy restrictions can lead to a second permission problem after the first one is fixed.
- Not redeploying the API after integration changes can make debugging feel inconsistent.
Summary
- This error usually starts with a bad or missing trust relationship on the IAM role.
- The role must trust
apigateway.amazonaws.comforsts:AssumeRole. - The same role also needs the right S3 permissions once assumed.
- Verify the exact role ARN configured in the integration.
- Redeploy the API after changes so you are testing the current configuration, not an old deployment.
Related reading
- AWS API Gateway Execution failed due to configuration error No match for output mapping and no default output mapping configured
- aws api gateway lambda multiple endpoint/functions vs single endpoint
- AWS API Gateway limit requests from a single IP
- AWS API Gateway No 'Access-Control-Allow-Origin' header is present
- AWS API Gateway OPTIONS requests returns 500 error
- AWS API Gateway User anonymous is not authorized to execute API
- AWS API Gateway VPC Link Pricing
- AWS API Get Any Resource By ARN

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.