aws / aws/aws-cdk

aws_docdbelastic : Changing AUTH_TYPE doesn't trigger replacement

Open
#29,251 2 comments 0 reactions 1 assignee Claimed by @pahud View on GitHub
@aws-cdk/aws-docdb bug effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the bug

Changing AUTH_TYPE doesn't trigger replacement

### Expected Behavior

When I try to change the `AUTH_TYPE` of Elastic docdb cluster from `PLAIN_TEXT` to `SECRET_ARN`, a replacement should be triggered. Wherein, the old cluster should be deleted and new cluster should be created.

### Current Behavior

When I try to change the `AUTH_TYPE` of Elastic docdb cluster from `PLAIN_TEXT` to `SECRET_ARN` or vice-versa, a new cluster is created but it fails with an error that cluster with this name already exists.

Error -
```
Cluster name xyz is not valid because cluster xyz exists. (Service: DocDbElastic, Status Code: 400, Request ID: 7bd649c5-77ff-4d38-85ca-2eb51fcb4c75)"
```

Even the CDK diff shows that the cluster will be replaced
```
~] AWS::DocDBElastic::Cluster elasticDocDbCluster elasticDocDbCluster replace
├─ [~] AdminUserPassword
│ └─ @@ -1,1 +1,3 @@
│ [-] "adminUserPassword"
│ [+] {
│ [+] "Ref": "docDbSecret44E78"
│ [+] }
└─ [~] AuthType (requires replacement)
├─ [-] PLAIN_TEXT
└─ [+] SECRET_ARN
```

### Reproduction Steps

Change `AUTH_TYPE` of existing cluster from CDK.

### Possible Solution

Cloud formation shows that it is creating a new resource. Shouldn't it delete the old one first?
![image](https://github.com/aws/aws-cdk/assets/46609729/e0490316-8256-4d42-a02a-7f8b98d2175c)

### Additional Information/Context

_No response_

### CDK CLI Version

2.123.0

### Framework Version

_No response_

### Node.js Version

v16.20.2

### OS

Linux/UNIX

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.