CfnDBCluster: Updating master_username shows replacement of resource while running cdk diff
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
I am creating a rds Dbcluster resource through cdk. However when i try to update the master_username property and while running the "cdk diff" command it shows that the resource requires replacement.
However i did go ahead and deployed the updated code anyway, it did update the stack but did not cause any replacement of the resource.
Is there any reason for this glitch or strange behavior?
The cdk code i used to deploy the Dbcluster resource
aurora_cluster = rds.CfnDBCluster(self, 'auroraCluster',
engine='aurora-mysql',
engine_version='5.7.mysql_aurora.2.08.1',
database_name = 'database05sep22',
master_username="masterUser",
master_user_password="masterUserPassword",
)
cdk diff output when i updated the master_username
Resources
[~] AWS::RDS::DBCluster auroraCluster auroraCluster replace
└─ [~] MasterUsername (requires replacement)
├─ [-] masterUser
└─ [+] masterUser123
### Expected Behavior
As per the cloudformation document for AWS::RDS::DBCluster the property "MasterUsername" says no interruption during update. So it should not be showing as replace while running the cdk diff command.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-masterusername
### Current Behavior
While running the cdk diff command I get resource replace message when i change the master_username property
[~] AWS::RDS::DBCluster auroraCluster auroraCluster replace
└─ [~] MasterUsername (requires replacement)
├─ [-] masterUser
└─ [+] masterUser123
### Reproduction Steps
It is a python code
=======================
aurora_cluster = rds.CfnDBCluster(self, 'auroraCluster',
engine='aurora-mysql',
engine_version='5.7.mysql_aurora.2.08.1',
database_name = 'database05sep22',
master_username="masterUser123",
master_user_password="masterUserPassword",)
========================
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.31.0 (build b67950d)
### Framework Version
_No response_
### Node.js Version
8.12.1
### OS
MAC
### Language
Python
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start by reproducing the Python AWS::RDS::DBCluster example with the CDK CLI version 2.31.0 and compare the cdk diff output for MasterUsername with the CloudFormation documentation linked in the issue. Check whether the diff's replacement classification matches the documented no-interruption update behavior; done means the diff no longer reports replacement when only master_username changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100