Skip to content

Instantly share code, notes, and snippets.

@ctala
Last active September 23, 2020 22:51
Show Gist options
  • Save ctala/24b53b49584cba0c097132aff8ff89e5 to your computer and use it in GitHub Desktop.
Save ctala/24b53b49584cba0c097132aff8ff89e5 to your computer and use it in GitHub Desktop.
AWS Sample Resource Policy VPC Whitelist and Resulted Policy from Serverless
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:us-west-2:607613765343:80nyvq2u70/*/*/*",
"Condition": {
"StringNotEquals": {
"aws:sourceVpc": "vpc-03602a6783bdefb87"
}
}
},
{
"Effect": "Allow",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:us-west-2:607613765343:80nyvq2u70/*/*/*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "execute-api:/{{stageNameOrWildcard}}/{{httpVerbOrWildcard}}/{{resourcePathOrWildcard}}",
"Condition": {
"StringNotEquals": {
"aws:sourceVpc": "{{vpcID}}"
}
}
},
{
"Effect": "Allow",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "execute-api:/{{stageNameOrWildcard}}/{{httpVerbOrWildcard}}/{{resourcePathOrWildcard}}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment