-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: custom domain name support for private endpoints #3719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dea23a9
Custom domain name support for private endpoints
0f8b474
Merge branch 'develop' into apigw
mbfreder 54a512b
fix lint issues
mbfreder 3057a36
more refactoring
mbfreder f79bc2e
Generate correct V2 resources
mbfreder 2e8184c
Add Policy property to AWS::Serverless::Api.Domain
mbfreder c365395
Address comments
mbfreder c3b8b4e
update tests
mbfreder fc41373
Merge branch 'develop' into apigw
mbfreder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
69 changes: 69 additions & 0 deletions
69
tests/translator/input/api_with_custom_domains_private.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Parameters: | ||
DomainName: | ||
Type: String | ||
Default: private.example.com | ||
Description: Custom domain name for the API | ||
|
||
CertificateArn: | ||
Type: String | ||
Default: arn:aws:acm:us-west-2:123456789:certificate/abcd-000-1234-0000-000000abcd | ||
Vandita2020 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Description: ARN of the ACM certificate for the domain | ||
|
||
VpcEndpointId: | ||
Type: String | ||
Default: vpce-abcd1234efg | ||
Description: VPC Endpoint ID for private API access | ||
|
||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: prod | ||
EndpointConfiguration: | ||
Type: PRIVATE | ||
Auth: | ||
ResourcePolicy: | ||
CustomStatements: | ||
- Effect: Allow | ||
Principal: '*' | ||
Action: execute-api:Invoke | ||
Resource: execute-api:/* | ||
- Effect: Deny | ||
Principal: '*' | ||
Action: execute-api:Invoke | ||
Resource: execute-api:/* | ||
Condition: | ||
StringNotEquals: | ||
aws:SourceVpce: !Ref VpcEndpointId | ||
|
||
ApiDomainName: | ||
Type: AWS::ApiGateway::DomainNameV2 | ||
Properties: | ||
DomainName: !Ref DomainName | ||
EndpointConfiguration: | ||
Types: | ||
- PRIVATE | ||
SecurityPolicy: TLS_1_2 | ||
RegionalCertificateArn: !Ref CertificateArn | ||
|
||
ApiMapping: | ||
Type: AWS::ApiGateway::BasePathMappingV2 | ||
Properties: | ||
DomainName: !Ref ApiDomainName | ||
RestApiId: !Ref MyApi | ||
Stage: prod | ||
|
||
DomainNameVpcEndpointAssociation: | ||
Type: AWS::ApiGateway::VpcEndpointAssociation | ||
Properties: | ||
DomainName: !Ref DomainName | ||
VpcEndpointId: !Ref VpcEndpointId | ||
|
||
Outputs: | ||
ApiDomainName: | ||
Description: Custom Domain Name for the API | ||
Value: !Ref DomainName | ||
|
||
ApiEndpoint: | ||
Description: API Gateway endpoint URL | ||
Value: !Sub https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/prod/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.