-
-
Save DanielRuskin1/cdddfa951bdb68fc09cea59cdd909935 to your computer and use it in GitHub Desktop.
My Serverless IAM Policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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