How can i add a resource policy to my serverless.yml

Hi guys!

First thanks for this great forum. It proved to be very helpful in the past. I’m currently playing around with exposing certain parts of my API via AWS. For this I was looking at resource policies, like this

{
   "Version": "2012-10-17",
   "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::account-id:user/Alice",
                    "account-id-2"
                ]
            },
            "Action": "execute-api:Invoke",
            "Resource": [
                "arn:aws:execute-api:region:account-id-1:api-id/stage/GET/pets"
            ]
        }
    ]
}

how can this be added to a my serverless.yml? Can I just put this at the end of my file or what is the standard following this?

Hi, maybe this is what you need https://github.com/serverless/serverless/issues/4926#issuecomment-422646518

1 Like