@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 CHANGED
@@ -1,10 +1,10 @@
1
- import {IDeployStack} from "./IDeployStack";
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 {IDomainConfig} from "./IDomainConfig";
4
+ import IDeployStack from "./IDeployStack";
5
+ import IDomainConfig from "./IDomainConfig";
6
6
 
7
- export default class ApiCertificate extends DnsValidatedCertificate {
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 {IStackArguments} from './IStackArguments'
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
@@ -0,0 +1,8 @@
1
+ import IHostedZoneConfig from "./IHostedZoneConfig";
2
+
3
+ export interface IDomainConfig {
4
+ domainName: string,
5
+ subdomain?: string,
6
+ hostedZone: IHostedZoneConfig
7
+ }
8
+ export default IDomainConfig
@@ -0,0 +1,5 @@
1
+ export interface IHostedZoneConfig {
2
+ name: string,
3
+ id: string
4
+ }
5
+ export default IHostedZoneConfig
@@ -1,7 +1,8 @@
1
- import {StackProps} from '@aws-cdk/core';
1
+ import {StackProps} from 'aws-cdk-lib/core';
2
2
 
3
3
  export interface IStackArguments extends StackProps {
4
4
  stage: string,
5
5
  project: string,
6
6
  owner: string
7
7
  }
8
+ export default IStackArguments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byaga/cdk-patterns",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Collection of common patterns used when making AWS CloudFormation templates using CDK",
5
5
  "main": " ",
6
6
  "scripts": {