@byaga/cdk-patterns 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApiCertificate.ts +7 -7
- package/IDeployStack.ts +2 -1
- package/IDomainConfig.ts +8 -0
- package/IHostedZoneConfig.ts +5 -0
- package/IStackArguments.ts +2 -1
- package/package.json +1 -1
package/ApiCertificate.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import {DnsValidatedCertificate} from "aws-cdk-lib/aws-certificatemanager";
|
1
|
+
import {Certificate, CertificateValidation} from "aws-cdk-lib/aws-certificatemanager";
|
3
2
|
import {HostedZone, IHostedZone} from "aws-cdk-lib/aws-route53";
|
4
3
|
import {CfnOutput} from "aws-cdk-lib";
|
5
|
-
import
|
4
|
+
import IDeployStack from "./IDeployStack";
|
5
|
+
import IDomainConfig from "./IDomainConfig";
|
6
6
|
|
7
|
-
export
|
7
|
+
export class ApiCertificate extends Certificate {
|
8
8
|
hostedZone: IHostedZone
|
9
9
|
domain: string
|
10
10
|
|
@@ -13,14 +13,13 @@ export default class ApiCertificate extends DnsValidatedCertificate {
|
|
13
13
|
if (domain.subdomain) certDomain.splice(0, 0, domain.subdomain)
|
14
14
|
const domainName = certDomain.join('.')
|
15
15
|
|
16
|
-
console.log(1, domainName, domain)
|
17
16
|
const hostedZone: IHostedZone = HostedZone.fromHostedZoneAttributes(stack, stack.genId(id, 'hosted-zone'), {
|
18
17
|
hostedZoneId: domain.hostedZone.id,
|
19
18
|
zoneName: domain.hostedZone.name
|
20
19
|
})
|
21
20
|
super(stack, stack.genId(id), {
|
22
21
|
domainName,
|
23
|
-
hostedZone
|
22
|
+
validation: CertificateValidation.fromDns(hostedZone)
|
24
23
|
});
|
25
24
|
|
26
25
|
this.domain = domainName
|
@@ -29,4 +28,5 @@ export default class ApiCertificate extends DnsValidatedCertificate {
|
|
29
28
|
exportName: stack.genName(id)})
|
30
29
|
this.hostedZone = hostedZone
|
31
30
|
}
|
32
|
-
}
|
31
|
+
}
|
32
|
+
export default ApiCertificate
|
package/IDeployStack.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import {Stack} from 'aws-cdk-lib';
|
2
|
-
import
|
2
|
+
import IStackArguments from './IStackArguments'
|
3
3
|
import {IConstruct} from "constructs";
|
4
4
|
|
5
5
|
export class IDeployStack extends Stack {
|
@@ -53,3 +53,4 @@ export class IDeployStack extends Stack {
|
|
53
53
|
return instance;
|
54
54
|
}
|
55
55
|
}
|
56
|
+
export default IDeployStack
|
package/IDomainConfig.ts
ADDED
package/IStackArguments.ts
CHANGED