Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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