cdk migrate: cdk migrate fails with "unreachable" error when template includes "AWS::RDS::DBCluster" that specifies the "ReadEndpoint" property
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the bug
When using the "cdk migrate" command to migrate an existing template that includes an "AWS::RDS::DBCluster" resource, the command fails if the resource includes the "ReadEndpoint" property. Please see the error below:
```
cdk migrate --from-path './CDKMigrateExampleTemplate.yml' --stack-name CustomStackName
...
❌ Migrate failed for `CustomStackName`: stack generation failed due to error 'unreachable'
stack generation failed due to error 'unreachable'
```
This issue also occurs when attempting to migrate an "AWS::RDS::DBSecurityGroup" resource when the "DBSecurityGroupIngress" property is specified.
### Expected Behavior
We are expecting cdk migrate to support all properties for the "AWS::RDS::DBCluster" resource as this resource is supported by IaC Generator
### Current Behavior
Migration command fails when the template includes an "AWS::RDS::DBCluster" that specifies the "ReadEndpoint" property. Commenting out the property results in a successful template migration.
### Reproduction Steps
Step 1: Use the below template with the cdk migrate command (should result in a successful run)
Step 2: Uncomment the "ReadEndpoint" property and retry the migrate command
```
Resources:
Cluster:
Type: AWS::RDS::DBCluster
Properties:
AllocatedStorage: 0
AssociatedRoles:
- DBClusterRole
AutoMinorVersionUpgrade: false
AvailabilityZones:
- String
BacktrackWindow: 0
BackupRetentionPeriod: 0
CopyTagsToSnapshot: false
DatabaseName: String
DBClusterIdentifier: String
DBClusterInstanceClass: String
DBClusterParameterGroupName: String
DBInstanceParameterGroupName: String
DBSubnetGroupName: String
DBSystemId: String
DeletionProtection: false
Domain: String
DomainIAMRoleName: String
EnableCloudwatchLogsExports:
- String
EnableGlobalWriteForwarding: false
EnableHttpEndpoint: false
EnableIAMDatabaseAuthentication: false
Engine: String
EngineMode: String
EngineVersion: String
GlobalClusterIdentifier: String
Iops: 0
KmsKeyId: String
ManageMasterUserPassword: false
MasterUsername: String
MasterUserPassword: String
MasterUserSecret:
MasterUserSecret
MonitoringInterval: 0
MonitoringRoleArn: String
NetworkType: String
PerformanceInsightsEnabled: false
PerformanceInsightsKmsKeyId: String
PerformanceInsightsRetentionPeriod: 0
Port: 0
PreferredBackupWindow: String
PreferredMaintenanceWindow: String
PubliclyAccessible: false
# ReadEndpoint:
# Address: String
ReplicationSourceIdentifier: String
RestoreToTime: String
RestoreType: String
ScalingConfiguration:
ScalingConfiguration
ServerlessV2ScalingConfiguration:
ServerlessV2ScalingConfiguration
SnapshotIdentifier: String
SourceDBClusterIdentifier: String
SourceRegion: String
StorageEncrypted: false
StorageType: String
Tags:
- Tag
UseLatestRestorableTime: false
VpcSecurityGroupIds:
- String
```
### Possible Solution
N/a
### Additional Information/Context
When creating a template for existing "AWS::RDS::DBCluster" within IaC generator, the "ReadEndpoint" property is always included in the generated template(even if empty). Thus, newly generated templates also present the "unreachable" error.
### CDK CLI Version
1.128.0
### Framework Version
_No response_
### Node.js Version
v18
### OS
MacOs
### Language
TypeScript
### Language Version
Occurs when generating templates in all languages
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.