Last active
November 24, 2018 10:07
-
-
Save mrserverless/0cfec7959d8e0134a19bc3700e0cfc76 to your computer and use it in GitHub Desktop.
API Gateway ResourcePolicy
This file contains hidden or 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
Resources: | |
MyAPI: | |
Type: AWS::Serverless::Api | |
Properties: | |
StageName: dev | |
DefinitionBody: | |
swagger: 2.0 | |
info: | |
title: !Ref AWS::StackName | |
x-amazon-apigateway-policy: | |
Version: 2012-10-17 | |
Statement: | |
- Effect: Allow | |
Principal: "*" | |
Action: execute-api:Invoke | |
Resource: !Sub arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:* | |
Condition: | |
IpAddress: | |
aws:SourceIp: !If | |
- ProdDeployment | |
- [ "10.0.0.1" ] | |
- [ | |
"10.0.0.2", # you can | |
"10.0.0.3/32", # list them | |
"10.0.0.4/32" # like this | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment