2
votes

I am trying to follow this job aid to create an API gateway rest endpiont with an s3 integration. https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html

However, when I try to create my execution role in IAM, there is only one use case at the bottom for API gateway. "Allows API Gateway to push logs to CloudWatch Logs." I am unable to attach an s3 policy the the API gateway role. Is this documentation out of date? How do I add the execution role for s3?

enter image description here

1
I think you might be conflating s3 bucket policies and iam polices. In this section here of the docs you linked describes the role that is getting that error. I believe in that example the api gateway does not have logging enabled, in the case in which does that role needs have permissions to put cloudwatch logs - jeffrey
Thank you for the reply. In the console, the cloudwatch logs is the only use case for creating a role with API gateway. It doesnt allow me to attach a policy to a role that allows API gateway permission to access s3 which doesnt seem correct. - Andrew Stockler

1 Answers

2
votes

First you create the role with the cloudwatch policy, then you go in your role list in IAM and find the role you just created , inside the role you can click on "attach policy" button and add any policies.

cheers