Skip to content
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

feat(amplify-domain): Added config for auto subdomain creation #13342

Merged
merged 10 commits into from
Mar 11, 2021
Prev Previous commit
Next Next commit
Added doc with AutoSubdomain feature
janario committed Mar 6, 2021
commit fa4e9369f5db268061cc6f27d98285b4c906ab9a
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-amplify/README.md
Original file line number Diff line number Diff line change
@@ -122,7 +122,10 @@ mySinglePageApp.addCustomRule(amplify.CustomRule.SINGLE_PAGE_APPLICATION_REDIREC
Add a domain and map sub domains to branches:

```ts
const domain = amplifyApp.addDomain('example.com');
const domain = amplifyApp.addDomain('example.com', {
enableAutoSubdomain: true, // in case subdomains should be auto registered for branches
autoSubdomainCreationPatterns: ['*', 'pr*'], // regex for branches that should auto register subdomains
});
domain.mapRoot(master); // map master branch to domain root
domain.mapSubDomain(master, 'www');
domain.mapSubDomain(dev); // sub domain prefix defaults to branch name