Skip to content

(cli): cdk import requires SetIdentifier for AWS::Route53::RecordSet and skips import if omitted #2001

Description

@ykageyama-mondo

Describe the bug

When attempting to import an existing AWS::Route53::RecordSet (e.g., A record or CNAME record) using cdk import, the interactive CLI prompt requires the SetIdentifier attribute to be specified.

Because SetIdentifier only exists for advanced routing policies and is not applicable to standard routing, it is an optional attribute. Despite this, leaving SetIdentifier empty during the prompt causes CDK to skip importing the resource entirely.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

SetIdentifier should be treated as optional. Leaving SetIdentifier blank should still allow change set creation (similar to the way Cloudformation imports via AWS Console work).

Current Behavior

SetIdentifier is non optional. If omitted, the resource import is skipped.

This is output from running cdk import and accepting all default values. (Some parts of the output are redacted)

👾 cdk:import | cdk import
start: Building aws-cdk-recreate-dev Template
success: Built aws-cdk-recreate-dev Template
start: Publishing aws-cdk-recreate-dev Template (290556015539-ap-southeast-2-37266d36)
success: Published aws-cdk-recreate-dev Template (290556015539-ap-southeast-2-37266d36)
aws-cdk-recreate-dev/ImportedARecord/Resource (AWS::Route53::RecordSet): enter Name (******) 
aws-cdk-recreate-dev/ImportedARecord/Resource (AWS::Route53::RecordSet): enter HostedZoneId (******) 
aws-cdk-recreate-dev/ImportedARecord/Resource (AWS::Route53::RecordSet): enter Type (A) 
aws-cdk-recreate-dev/ImportedARecord/Resource (AWS::Route53::RecordSet): enter SetIdentifier (empty to skip) 
Skipping import of aws-cdk-recreate-dev/ImportedARecord/Resource
No resources selected for import.

If an arbitrary value is passed for SetIdentifier, change set creation fails since there is no matching Route 53 record with that SetIdentifier.

Reproduction Steps

https://github.com/ykageyama-mondo/aws-cdk-cli-import-issue-recreate

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.1143.0 (build 9c6bd0e)

Framework Version

No response

Node.js Version

v24.11.1

OS

EndeavourOS x86_64

Language

TypeScript

Language Version

6.0.3

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions