Skip to content

Commit b197351

Browse files
committed
Added config for auto subdomain creation
1 parent cbed348 commit b197351

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/@aws-cdk/aws-amplify/lib/domain.ts

+16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ export interface DomainOptions {
2121
* @default - use `addSubDomain()` to add subdomains
2222
*/
2323
readonly subDomains?: SubDomain[];
24+
25+
/**
26+
* Automatically create subdomains for connected branches
27+
*
28+
* @default false
29+
*/
30+
readonly domainEnableAutoSubDomain: boolean;
31+
32+
/**
33+
* Branches which should automatically create subdomains
34+
*
35+
* @default - all repository branches *, pr*
36+
*/
37+
readonly domainAutoSubDomainCreationPatterns?: string[];
2438
}
2539

2640
/**
@@ -106,6 +120,8 @@ export class Domain extends Resource {
106120
appId: props.app.appId,
107121
domainName,
108122
subDomainSettings: Lazy.any({ produce: () => this.renderSubDomainSettings() }, { omitEmptyArray: true }),
123+
enableAutoSubDomain: !!props.domainEnableAutoSubDomain,
124+
autoSubDomainCreationPatterns: props.domainAutoSubDomainCreationPatterns,
109125
});
110126

111127
this.arn = domain.attrArn;

0 commit comments

Comments
 (0)