amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.
MIT License
941 stars 232 forks source link

hostedZonePrivate parameter is not honoured in v6.2.0 #526

Closed Rowan002 closed 2 years ago

Rowan002 commented 2 years ago

Community Note

Bug Report

Error Description Since v6.2.0 introduction of the splitHorizonDns parameter and subsequent refactoring, the hostedZonePrivate parameter is no longer honoured when filtering target hosted zones.

Command Run sls deploy

Domain Manager Configuration

custom:
  customDomain:
    domainName: ${self:custom.domainName.full}
    hostedZonePrivate: true
    certificateName: ${self:custom.domainName.full}
    basePath: ''
    stage: ${self:custom.stage}
    createRoute53Record: true
    endpointType: regional
    autoDomain: true

Versions

Possible Solution The following line should specify the second argument for hostedZonePrivate. https://github.com/amplify-education/serverless-domain-manager/blob/master/src/aws/route53-wrapper.ts#L37

const route53HostedZoneId = await this.getRoute53HostedZoneId(domain); const route53HostedZoneId = await this.getRoute53HostedZoneId(domain, domain.hostedZonePrivate);

This seems to have been introduced on this commit: https://github.com/amplify-education/serverless-domain-manager/commit/e0e67d798827f585784d4683326514a46d1c240c#diff-343342879313fd7673a6f0651848f7ed358a2b98e55f0ed4554fcf35f0ba5ee8