Skip to content

Instantly share code, notes, and snippets.

@DanielRuskin1
Created May 30, 2016 19:28
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save DanielRuskin1/cdddfa951bdb68fc09cea59cdd909935 to your computer and use it in GitHub Desktop.
Save DanielRuskin1/cdddfa951bdb68fc09cea59cdd909935 to your computer and use it in GitHub Desktop.
My Serverless IAM Policy
# You'll need to fill in SERVERLESS_PROJECT_NAME and API_GATEWAY_ID with the appropriate values.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:Get*",
"lambda:List*",
"lambda:CreateFunction"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"lambda:AddPermission",
"lambda:CreateAlias",
"lambda:DeleteFunction",
"lambda:InvokeFunction",
"lambda:PublishVersion",
"lambda:RemovePermission",
"lambda:Update*"
],
"Resource": "arn:aws:lambda:*:*:function:SERVERLESS_PROJECT_NAME*"
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": "arn:aws:iam::*:role/SERVERLESS_PROJECT_NAME*"
},
{
"Effect": "Allow",
"Action": [
"apigateway:GET"
],
"Resource": "arn:aws:apigateway:*::/restapis"
},
{
"Effect": "Allow",
"Action": [
"apigateway:*"
],
"Resource": "arn:aws:apigateway:*::/restapis/API_GATEWAY_ID/*"
},
{
"Effect": "Allow",
"Action": [
"events:PutRule"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"events:PutTargets"
],
"Condition": {
"ArnLike": {
"events:TargetArn": "arn:aws:lambda:*:*:function:SERVERLESS_PROJECT_NAME*"
}
},
"Resource": "*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment