Skip to content

Commit 49b2627

Browse files
authored
feat: deprecating delete existing field in ARecord (#35039)
### Issue # (if applicable) Closes #34230 ### Reason for this change This field is confusing customers, also make bad experience since it gave them downtime for their application, beside this if there's a deployment failure the ARecord will not rollback and will be deleted forever until the user manually create one, at the moment there's no way to make it rollbackable. ### Description of changes Deprecating property in ARecord construct ### Describe any new or updated permissions being added N/A ### Description of how you validated changes N/A ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
1 parent 576c9ec commit 49b2627

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

DEPRECATED_APIs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
| Module | API Element | Message |
44
|--------|-------------|---------|
5+
| aws-cdk-lib/aws-route53 | RecordSetOptions.​deleteExisting | This property is dangerous and can lead to unintended record deletion in case of deployment failure.|
56
| @aws-cdk/core | AppProps.​runtimeInfo | use `versionReporting` instead |
67
| @aws-cdk/core | Arn.​parse() | use split instead |
78
| @aws-cdk/core | ArnComponents.​sep | use arnFormat instead |

packages/aws-cdk-lib/aws-route53/lib/record-set.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export interface RecordSetOptions {
219219
* > an existing Record Set's `deleteExisting` property from `false -> true` after deployment
220220
* > will delete the record!
221221
*
222+
* @deprecated This property is dangerous and can lead to unintended record deletion in case of deployment failure.
222223
* @default false
223224
*/
224225
readonly deleteExisting?: boolean;
@@ -419,6 +420,7 @@ export class RecordSet extends Resource implements IRecordSet {
419420
this.domainName = recordSet.ref;
420421

421422
if (props.deleteExisting) {
423+
Annotations.of(this).addWarningV2('@aws-cdk/aws-route53:deleteExisting', 'deleteExisting field is deprecated do not use it');
422424
// Delete existing record before creating the new one
423425
const provider = DeleteExistingRecordSetProvider.getOrCreateProvider(this, DELETE_EXISTING_RECORD_SET_RESOURCE_TYPE, {
424426
policyStatements: [{ // IAM permissions for all providers

0 commit comments

Comments
 (0)