Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from keithduncan/fix-vpc-template-parameter
Browse files Browse the repository at this point in the history
Provide a default value for SourceVpcIDs
  • Loading branch information
keithduncan authored Apr 21, 2020
2 parents f18105a + c674fcc commit 9143f66
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions service/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Parameters:
Description: Comma separated list of AWS AccountIds whose IAM entities should be allowed to access the API Gateway.
SourceVpcIds:
Type: CommaDelimitedList
Description: Comma separated list of AWS VPC IDs whose occupants should be allowed to access the API Gateway, only applicable when EndpointConfiguration is PRIVATE.
Description: Optional - Comma separated list of AWS VPC IDs whose occupants should be allowed to access the API Gateway, only applicable when EndpointConfiguration is PRIVATE.
Default: ''

Conditions:
AccountRestriction: !Not [ !Equals [ !Join [ ',', !Ref AccountIds ] , '' ] ]
VpcRestriction: !Not [ !Equals [ !Join [ ',', !Ref SourceVpcIds ] , '' ] ]

Metadata:
AWS::CloudFormation::Interface:
Expand Down Expand Up @@ -60,8 +65,8 @@ Globals:
DefaultAuthorizer: AWS_IAM
InvokeRole: NONE
ResourcePolicy:
AwsAccountWhitelist: !Ref AccountIds
SourceVpcWhitelist: !Ref SourceVpcIds
AwsAccountWhitelist: !If [ AccountRestriction, !Ref AccountIds, !Ref AWS::NoValue ]
SourceVpcWhitelist: !If [ VpcRestriction, !Ref SourceVpcIds, !Ref AWS::NoValue ]
EndpointConfiguration: !Ref EndpointConfiguration

Resources:
Expand Down

0 comments on commit 9143f66

Please sign in to comment.