Forked from dfischer/gist:2817e8de4dad14a968fe0681990b838c
Created
March 20, 2018 00:46
-
-
Save simlu/6735d181f0e79a1c87ba32a32620ba77 to your computer and use it in GitHub Desktop.
serverless.yml iam template
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:Describe*", | |
"cloudformation:List*", | |
"cloudformation:Get*", | |
"cloudformation:PreviewStackUpdate", | |
"cloudformation:CreateStack", | |
"cloudformation:UpdateStack" | |
], | |
"Resource": "arn:aws:cloudformation:<region>:<account_no>:stack/<service_name>*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:ValidateTemplate" | |
], | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:Get*", | |
"s3:List*" | |
], | |
"Resource": [ | |
"arn:aws:s3:::<your_deployment_bucket>" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:*" | |
], | |
"Resource": [ | |
"arn:aws:s3:::<your_deployment_bucket>/*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:DescribeLogGroups" | |
], | |
"Resource": "arn:aws:logs:<region>:<account_no>:log-group::log-stream:*" | |
}, | |
{ | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:DeleteLogGroup", | |
"logs:DeleteLogStream", | |
"logs:DescribeLogStreams", | |
"logs:FilterLogEvents" | |
], | |
"Resource": "arn:aws:logs:<region>:<account_no>:log-group:/aws/lambda/<service_name>*:log-stream:*", | |
"Effect": "Allow" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetRole", | |
"iam:PassRole", | |
"iam:CreateRole", | |
"iam:DeleteRole", | |
"iam:DetachRolePolicy", | |
"iam:PutRolePolicy", | |
"iam:AttachRolePolicy", | |
"iam:DeleteRolePolicy" | |
], | |
"Resource": [ | |
"arn:aws:iam::<account_no>:role/<service_name>*-lambdaRole" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"apigateway:GET", | |
"apigateway:POST", | |
"apigateway:PUT", | |
"apigateway:DELETE" | |
], | |
"Resource": [ | |
"arn:aws:apigateway:<region>::/restapis" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"apigateway:GET", | |
"apigateway:POST", | |
"apigateway:PUT", | |
"apigateway:DELETE" | |
], | |
"Resource": [ | |
"arn:aws:apigateway:<region>::/restapis/*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"lambda:GetFunction", | |
"lambda:CreateFunction", | |
"lambda:DeleteFunction", | |
"lambda:UpdateFunctionConfiguration", | |
"lambda:UpdateFunctionCode", | |
"lambda:ListVersionsByFunction", | |
"lambda:PublishVersion", | |
"lambda:CreateAlias", | |
"lambda:DeleteAlias", | |
"lambda:UpdateAlias", | |
"lambda:GetFunctionConfiguration", | |
"lambda:AddPermission", | |
"lambda:InvokeFunction" | |
], | |
"Resource": [ | |
"arn:aws:lambda:*:<account_no>:function:<service_name>*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:DescribeSecurityGroups", | |
"ec2:DescribeSubnets", | |
"ec2:DescribeVpcs" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"events:Put*", | |
"events:Remove*", | |
"events:Delete*", | |
"events:Describe*" | |
], | |
"Resource": "arn:aws:events::<account_no>:rule/<service_name>*" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment