aws / aws/aws-cdk

route53: RecordSet `deleteExisting` will delete target recordset if changed from `false` to `true`

Open
#23,661 0 comments 3 reactions 0 assignees View on GitHub
@aws-cdk/aws-route53 bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

RecordSet tries to offer a clever feature with `deleteExisting: true`, which will delete any existing RecordSet before creating a new one.

However, this feature only works if you put `deleteExisting: true` in your CDK code right away.

If you first have it at `false`, deploy, and then change it to `true` later, the Custom Resource is actually going to delete the record created by the previous CDK deployment.

### Expected Behavior

I don't know what I expected changing `deleteExisting: false -> true` after already creating a record, because I wasn't the user to do this. It's a little weird.

But certainly, the expected behavior should have been a no-op, not a deletion of "my" record.

### Current Behavior

My record is deleted.

### Reproduction Steps

Already described.

### Possible Solution

We could TAG the record with the stack name, and have the Custom Resource not delete it if it's associated with the current stack.

For now, I'm not implementing this, I'm just putting big warning tape around the feature.

### Additional Information/Context

_No response_

### CDK CLI Version

-

### Framework Version

-

### Node.js Version

-

### OS

-

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the TypeScript implementation and tests for the Route53 RecordSet custom resource and its deleteExisting option. Reproduce a deployment that changes false to true, then verify the existing record is not deleted and add regression coverage. The issue does not name files or tests, so the exact entry points must be found first.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.