Skip to content

Instantly share code, notes, and snippets.

@DoguD
Created August 28, 2024 14:18
Show Gist options
  • Save DoguD/92da2d212cb36c7c891ce8f81b1e73f5 to your computer and use it in GitHub Desktop.
Save DoguD/92da2d212cb36c7c891ce8f81b1e73f5 to your computer and use it in GitHub Desktop.
Policy to be used for running `chalice deploy` with Github Actions.
{
"Version": "2024-08-28",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:GetRole",
"logs:DeleteLogGroup",
"apigateway:PUT",
"iam:CreateRole",
"iam:DeleteRole",
"iam:PutRolePolicy",
"logs:CreateLogGroup",
"cloudformation:DescribeStacks",
"apigateway:DELETE",
"iam:PassRole",
"cloudformation:CreateStack",
"iam:DeleteRolePolicy",
"cloudformation:DeleteStack",
"apigateway:PATCH",
"cloudformation:UpdateStack",
"apigateway:POST",
"apigateway:GET",
"cloudformation:ListStackResources"
],
"Resource": [
"arn:aws:iam::*:role/*",
"arn:aws:cloudformation:*:*:stack/*",
"arn:aws:logs:*:*:*",
"arn:aws:apigateway:*::/restapis",
"arn:aws:apigateway:*::/restapis/*"
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"apigateway:DELETE",
"apigateway:PUT",
"apigateway:PATCH",
"apigateway:POST",
"apigateway:GET"
],
"Resource": [
"arn:aws:apigateway:*::/restapis/*",
"arn:aws:apigateway:*::/restapis"
]
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": [
"lambda:CreateFunction",
"lambda:TagResource",
"lambda:InvokeFunction",
"lambda:GetFunction",
"lambda:UpdateFunctionConfiguration",
"lambda:GetFunctionConfiguration",
"lambda:UntagResource",
"lambda:UpdateFunctionCode",
"lambda:AddPermission",
"lambda:ListTags",
"lambda:*",
"lambda:DeleteFunction",
"lambda:RemovePermission"
],
"Resource": "*"
},
{
"Sid": "VisualEditor3",
"Effect": "Allow",
"Action": "logs:DescribeLogGroups",
"Resource": "arn:aws:logs:*:*:*"
},
{
"Sid": "VisualEditor4",
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:DeleteStack",
"cloudformation:UpdateStack",
"cloudformation:DescribeStacks",
"cloudformation:ListStackResources"
],
"Resource": "arn:aws:cloudformation:*:*:stack/*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment