-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: custom domains Api Gateway support #1144
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 all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
629776b
feat: add support for custom domains basic case
praneetap 28cb600
Adding tests for edge functionality
praneetap 3aa007f
adding docs and test for intrinsics
praneetap b45128f
Minor test fixes
praneetap cd47f8b
feat: support for basepath mappings for a single api
praneetap 680d212
add intrinsic support
praneetap b7be810
throwing errors of the domain template is invalid
praneetap ba39b64
Remove basepath / check, and fix logical name creation of basepath
praneetap ce029de
adding an example
praneetap 5bd8ede
fix the docs
praneetap 7df2285
docs: fix link to Github issues (#1149)
ae108d7
comment fix
praneetap 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
19 changes: 19 additions & 0 deletions
19
examples/2016-10-31/custom_domains_without_route53/README.md
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,19 @@ | ||
| # Custom Domains support | ||
|
|
||
| Example SAM template for setting up Api Gateway resources for custom domains. | ||
|
|
||
| ## Prerequisites for setting up custom domains | ||
| 1. A domain name. You can purchase a domain name from a domain name provider. | ||
| 1. A certificate ARN. Set up or import a valid certificate into AWS Certificate Manager. | ||
|
|
||
| ## PostRequisites | ||
| After deploying the template, make sure you configure the DNS settings on the domain name provider's website. You will need to add Type A and Type AAAA DNS records that are point to ApiGateway's Hosted Zone Id. Read more [here](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-api-gateway.html) | ||
|
|
||
| ## Running the example | ||
|
|
||
| ```bash | ||
| $ sam deploy \ | ||
| --template-file /path_to_template/packaged-template.yaml \ | ||
| --stack-name my-new-stack \ | ||
| --capabilities CAPABILITY_IAM | ||
| ``` |
37 changes: 37 additions & 0 deletions
37
examples/2016-10-31/custom_domains_without_route53/template.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,37 @@ | ||
| Parameters: | ||
| MyDomainName: | ||
| Type: String | ||
| Default: another-example.com | ||
|
|
||
| MyDomainCert: | ||
| Type: String | ||
| Default: another-api-arn | ||
|
|
||
| Globals: | ||
| Api: | ||
| Domain: | ||
| DomainName: !Ref MyDomainName | ||
| CertificateArn: !Ref MyDomainCert | ||
| EndpointConfiguration: 'REGIONAL' | ||
| BasePath: ['/get'] | ||
|
|
||
| Resources: | ||
| MyFunction: | ||
| Type: AWS::Serverless::Function | ||
| Properties: | ||
| InlineCode: | | ||
| exports.handler = async (event) => { | ||
| const response = { | ||
| statusCode: 200, | ||
| body: JSON.stringify('Hello from Lambda!'), | ||
| }; | ||
| return response; | ||
| }; | ||
| Handler: index.handler | ||
| Runtime: nodejs8.10 | ||
| Events: | ||
| ImplicitGet: | ||
| Type: Api | ||
| Properties: | ||
| Method: Get | ||
| Path: /get |
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
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
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.