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

aws
#1

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?

0 Likes

#2

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

0 Likes