Last active
January 18, 2021 10:56
-
-
Save marioarizaj/59fd2076f12a767606e0ae98f48a5457 to your computer and use it in GitHub Desktop.
Serverless policy for IAM user
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:List*", | |
"cloudformation:Get*", | |
"cloudformation:ValidateTemplate" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", | |
"cloudformation:DeleteStack", | |
"cloudformation:Describe*", | |
"cloudformation:UpdateStack", | |
"cloudformation:DescribeStacks" | |
], | |
"Resource": [ | |
"arn:aws:cloudformation:eu-central-1:*:stack/serverless-example-dev/*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"lambda:Get*", | |
"lambda:List*", | |
"lambda:CreateFunction" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetBucketLocation", | |
"s3:CreateBucket", | |
"s3:DeleteBucket", | |
"s3:ListBucket", | |
"s3:ListBucketVersions", | |
"s3:PutAccelerateConfiguration", | |
"s3:GetEncryptionConfiguration", | |
"s3:PutEncryptionConfiguration" | |
], | |
"Resource": [ | |
"arn:aws:s3:::serverless-example*serverlessdeploy*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:PutObject", | |
"s3:GetObject", | |
"s3:DeleteObject" | |
], | |
"Resource": [ | |
"arn:aws:s3:::serverless-example*serverlessdeploy*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"lambda:AddPermission", | |
"lambda:CreateAlias", | |
"lambda:DeleteFunction", | |
"lambda:InvokeFunction", | |
"lambda:PublishVersion", | |
"lambda:RemovePermission", | |
"lambda:Update*" | |
], | |
"Resource": [ | |
"arn:aws:lambda:eu-central-1:*:function:serverless-example-dev-*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"apigateway:GET", | |
"apigateway:POST", | |
"apigateway:PUT", | |
"apigateway:DELETE", | |
"apigateway:PATCH" | |
], | |
"Resource": [ | |
"arn:aws:apigateway:*::/restapis*", | |
"arn:aws:apigateway:*::/apikeys*", | |
"arn:aws:apigateway:*::/usageplans*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:PassRole" | |
], | |
"Resource": [ | |
"arn:aws:iam::*:role/*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": "kinesis:*", | |
"Resource": [ | |
"arn:aws:kinesis:*:*:stream/serverless-example-dev-eu-central-1" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetRole", | |
"iam:CreateRole", | |
"iam:PutRolePolicy", | |
"iam:DeleteRolePolicy", | |
"iam:DeleteRole" | |
], | |
"Resource": [ | |
"arn:aws:iam::*:role/serverless-example-dev-eu-central-1-lambdaRole" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": "sqs:*", | |
"Resource": [ | |
"arn:aws:sqs:*:*:serverless-example-dev-eu-central-1" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudwatch:GetMetricStatistics" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:DeleteLogGroup" | |
], | |
"Resource": [ | |
"arn:aws:logs:eu-central-1:*:*" | |
], | |
"Effect": "Allow" | |
}, | |
{ | |
"Action": [ | |
"logs:PutLogEvents" | |
], | |
"Resource": [ | |
"arn:aws:logs:eu-central-1:*:*" | |
], | |
"Effect": "Allow" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:DescribeLogStreams", | |
"logs:DescribeLogGroups", | |
"logs:FilterLogEvents" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"events:Put*", | |
"events:Remove*", | |
"events:Delete*" | |
], | |
"Resource": [ | |
"arn:aws:events:*:*:rule/serverless-example-dev-eu-central-1" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"events:DescribeRule" | |
], | |
"Resource": [ | |
"arn:aws:events:eu-central-1:*:rule/serverless-example-dev-*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:CreateBucket", | |
"s3:PutBucketPolicy" | |
], | |
"Resource": [ | |
"arn:aws:s3:::*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"*" | |
], | |
"Resource": [ | |
"arn:aws:apigateway:eu-central-1::/apis", | |
"arn:aws:apigateway:eu-central-1::/apis/*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:*" | |
], | |
"Resource": [ | |
"*" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment