aws / aws/aws-cdk

aws-codestarnotifications: Provide custom resource for deleting existing notification rules

Open
#32,892 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-codestarnotifications feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

When adding new features to or refactoring `NotificationRules`, you can get:

```
The notification rule was not created because another notification rule already exists with the same name.
Notification rule names must be unique within an AWS account.
This helps prevent exceeding the maximum allowed number of notification rules.
(Service: CodestarNotifications, Status Code: 409, Request ID: <>" (RequestToken: <>, HandlerErrorCode: AlreadyExists)`)
```

This seems to happen because Cfn tries to create a new notification rule before deleting the existing rule.

It would be great to have a way to delete the existing rule to avoid running into this.

### Use Case

See above

### Proposed Solution

I propose, similar to how route53 `CnameRecord`'s has a `delete_existing` (see https://github.com/aws/aws-cdk/pull/20416) attribute that calls a custom resource, we do the same with notification rules to avoid the above error.

### Other Information

The workaround right now is deleting the existing notification rule in the console and redeploying.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.175.1

### Environment details (OS name and version, etc.)

Darwin

Contributor guide

Open the contributing guide

Research direction

Start by locating the NotificationRules implementation and reviewing the Route 53 CnameRecord delete_existing change linked in the issue. Define the custom-resource behavior for removing an existing notification rule before replacement, then verify that a deployment with an existing same-named rule completes successfully.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.