Skip to content

aws-route53: (BREAKING!) Imported Route53 zone attribute and/or type mismatch #26872

@einstein-aws

Description

@einstein-aws

Describe the bug

Seems like after the latest CDK update to v2.93.0 I am having trouble with importing Route53 hosted zones. I tried:

const route53Zone = r53.HostedZone.fromLookup(this, 'my-route53-zone', { domainName: 'mydomain.com' });

and...

const route53Zone = r53.PublicHostedZone.fromLookup(this, 'my-route53-zone', { domainName: 'mydomain.com' });

and...

const route53Zone = r53.HostedZone.fromHostedZoneAttributes(this, 'my-route53-zone', { zoneName: 'mydomain.com', hostedZoneId: 'my-zone-id' });

and...

const route53Zone = r53.PublicHostedZone.fromHostedZoneAttributes(this, 'my-route53-zone', { zoneName: 'mydomain.com', hostedZoneId: 'my-zone-id' });

and when I tried:

const sesIdentity = ses.Identity.publicHostedZone(route53Zone);

I am getting:

Argument of type 'IHostedZone' is not assignable to parameter of type 'IPublicHostedZone'.
  Property 'grantDelegation' is missing in type 'IHostedZone' but required in type 'IPublicHostedZone'.ts(2345)
hosted-zone.d.ts(146, 5): 'grantDelegation' is declared here.

Expected Behavior

Either of the above imports should work.

Current Behavior

Getting error:

Argument of type 'IHostedZone' is not assignable to parameter of type 'IPublicHostedZone'.
  Property 'grantDelegation' is missing in type 'IHostedZone' but required in type 'IPublicHostedZone'.ts(2345)
hosted-zone.d.ts(146, 5): 'grantDelegation' is declared here.

Reproduction Steps

Try to use either of the above Route53 zone imports in:

const sesIdentity = ses.Identity.publicHostedZone(route53Zone);

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

v2.93.0

Framework Version

No response

Node.js Version

v18.12.0

OS

MacOS Ventura 13.4.1

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-route53Related to Amazon Route 53bugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions