Skip to content

RDS Create DB Cluster required random source identifier #2762

@jazzyarchitects

Description

@jazzyarchitects

Describe the bug

When calling CreateDBClusterCommand with a set of input, the AWS SDK RDS middleware throws an error saying Source identifier key not set.

Your environment

SDK version number

@aws-sdk/client-rds@3.29.0

Is the issue in the browser/Node.js/ReactNative?

Node.js

Details of the browser/Node.js/ReactNative version

Lambda Node.js 14.x

Steps to reproduce

const input = {
  "AvailabilityZones": [
    "us-east-1b",
    "us-east-1c",
    "us-east-1d"
  ],
  "BackupRetentionPeriod": 15,
  "CopyTagsToSnapshot": true,
  "DBClusterParameterGroupName": "xxxx",
  "DBSubnetGroupName": "xxxx",
  "DeletionProtection": true,
  "EnableIAMDatabaseAuthentication": true,
  "EngineVersion": "5.7.mysql_aurora.2.10.0",
  "Engine": "aurora-mysql",
  "KmsKeyId": "xxxx",
  "MasterUsername": "xxxx",
  "PreferredBackupWindow": "01:00-03:00",
  "PreferredMaintenanceWindow": "sun:06:00-sun:07:00 UTC",
  "StorageEncrypted": true,
  "VpcSecurityGroupIds": [
    "xxxx"
  ],
  "Tags": [],
  "MasterUserPassword": "xxxx",
  "DBClusterIdentifier": "test-api-prod-db-cluster",
  "DatabaseName": "test_api"
};

const client = new RDSClient({region: 'us-east-1'});
const command = new CreateDBClusterCommand(input);

await client.send(command);

Observed behavior

Throws error saying Source identifier key not set

Expected behavior

Cluster should be created subject to IAM permissions.

Screenshots

This throws error.
Screenshot 2021-09-08 at 12 33 09 PM

Adding random value to SourceDBSnapshotIdentifier returns expected behaviour
Screenshot 2021-09-08 at 12 34 38 PM

Additional context

Adding any random value to one of the key mentioned at (node_modules/@aws-sdk/middleware-sdk-rds/src/index.ts) makes the validation pass through.

const sourceIds: string[] = [
  "SourceDBSnapshotIdentifier",
  "SourceDBInstanceIdentifier",
  "ReplicationSourceIdentifier",
  "SourceDBClusterSnapshotIdentifier",
  "SourceDBInstanceArn",
];

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions