Describe the bug
Have a console created an S3 bucket & attempted to import using cdk migrate. When running cdk diff or cdk diff --import-existing-resources, the S3 Bucket shows up but is missing the import keyword at the end, and cdk deploy fails due to AlreadyExists. The S3 Bucket has 0 dependents/dependencies. In my search, I've been needing to find underlying code detailing how cdk migrate determines whether an exact resource should be created new or not.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The stack controls the existing S3 bucket specified without re-creation.
Current Behavior
cdk deploy fails due to AlreadyExists for the S3 resource.
Reproduction Steps
- On Console/S3, create an S3 bucket.
- On Console/Cfn, create an IaC Generator resource scan for S3
- On Console/Cfn, create & download an IaC Generator template matching only the S3 bucket created in Step 1.
- On cli, run
cdk migrate --from-path <downloaded-template> --stack-name "S3ScannedStack"
- On cli, run
cdk synth
- On cli, run
cdk diff or run cdk diff --import-existing-resources note S3 resource is not appended with import
- On cli, run
cdk bootstrap
- On cli, run
cdk deploy
Possible Solution
No response
Additional Information/Context
I'm fully aware that you can run cdk migrate --from-scan or various Console methods, they all result in the same error. These reproduction steps are for your comprehension.
CDK CLI Version
latest
Framework Version
No response
Node.js Version
n/a
OS
Linux
Language
TypeScript
Language Version
No response
Other information
No response
Describe the bug
Have a console created an S3 bucket & attempted to import using
cdk migrate. When runningcdk difforcdk diff --import-existing-resources, the S3 Bucket shows up but is missing the import keyword at the end, andcdk deployfails due toAlreadyExists. The S3 Bucket has 0 dependents/dependencies. In my search, I've been needing to find underlying code detailing howcdk migratedetermines whether an exact resource should be created new or not.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The stack controls the existing S3 bucket specified without re-creation.
Current Behavior
cdk deployfails due toAlreadyExistsfor the S3 resource.Reproduction Steps
cdk migrate --from-path <downloaded-template> --stack-name "S3ScannedStack"cdk synthcdk diffor runcdk diff --import-existing-resourcesnote S3 resource is not appended with importcdk bootstrapcdk deployPossible Solution
No response
Additional Information/Context
I'm fully aware that you can run
cdk migrate --from-scanor various Console methods, they all result in the same error. These reproduction steps are for your comprehension.CDK CLI Version
latest
Framework Version
No response
Node.js Version
n/a
OS
Linux
Language
TypeScript
Language Version
No response
Other information
No response