Skip to content

Commit 549616d

Browse files
author
awstools
committed
feat(client-rds): Introduced support for the InsufficientDBInstanceCapacityFault error in the RDS CreateDBCluster API method. This provides enhanced error handling, ensuring a more robust experience when creating database clusters with insufficient instance capacity.
1 parent 8ceeeff commit 549616d

File tree

4 files changed

+119
-21
lines changed

4 files changed

+119
-21
lines changed

clients/client-rds/src/commands/CreateDBClusterCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ export interface CreateDBClusterCommandOutput extends CreateDBClusterResult, __M
347347
* @throws {@link GlobalClusterNotFoundFault} (client fault)
348348
* <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster.</p>
349349
*
350+
* @throws {@link InsufficientDBInstanceCapacityFault} (client fault)
351+
* <p>The specified DB instance class isn't available in the specified Availability
352+
* Zone.</p>
353+
*
350354
* @throws {@link InsufficientStorageClusterCapacityFault} (client fault)
351355
* <p>There is insufficient storage available for the current action. You might be able to
352356
* resolve this error by updating your subnet group to use different Availability Zones

clients/client-rds/src/models/models_0.ts

+21-21
Original file line numberDiff line numberDiff line change
@@ -6244,6 +6244,27 @@ export class GlobalClusterNotFoundFault extends __BaseException {
62446244
}
62456245
}
62466246

6247+
/**
6248+
* @public
6249+
* <p>The specified DB instance class isn't available in the specified Availability
6250+
* Zone.</p>
6251+
*/
6252+
export class InsufficientDBInstanceCapacityFault extends __BaseException {
6253+
readonly name: "InsufficientDBInstanceCapacityFault" = "InsufficientDBInstanceCapacityFault";
6254+
readonly $fault: "client" = "client";
6255+
/**
6256+
* @internal
6257+
*/
6258+
constructor(opts: __ExceptionOptionType<InsufficientDBInstanceCapacityFault, __BaseException>) {
6259+
super({
6260+
name: "InsufficientDBInstanceCapacityFault",
6261+
$fault: "client",
6262+
...opts,
6263+
});
6264+
Object.setPrototypeOf(this, InsufficientDBInstanceCapacityFault.prototype);
6265+
}
6266+
}
6267+
62476268
/**
62486269
* @public
62496270
* <p>There is insufficient storage available for the current action. You might be able to
@@ -9422,27 +9443,6 @@ export class DBInstanceAlreadyExistsFault extends __BaseException {
94229443
}
94239444
}
94249445

9425-
/**
9426-
* @public
9427-
* <p>The specified DB instance class isn't available in the specified Availability
9428-
* Zone.</p>
9429-
*/
9430-
export class InsufficientDBInstanceCapacityFault extends __BaseException {
9431-
readonly name: "InsufficientDBInstanceCapacityFault" = "InsufficientDBInstanceCapacityFault";
9432-
readonly $fault: "client" = "client";
9433-
/**
9434-
* @internal
9435-
*/
9436-
constructor(opts: __ExceptionOptionType<InsufficientDBInstanceCapacityFault, __BaseException>) {
9437-
super({
9438-
name: "InsufficientDBInstanceCapacityFault",
9439-
$fault: "client",
9440-
...opts,
9441-
});
9442-
Object.setPrototypeOf(this, InsufficientDBInstanceCapacityFault.prototype);
9443-
}
9444-
}
9445-
94469446
/**
94479447
* @public
94489448
* <p>The network type is invalid for the DB instance. Valid nework type values are <code>IPV4</code> and <code>DUAL</code>.</p>

clients/client-rds/src/protocols/Aws_query.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4631,6 +4631,9 @@ const de_CreateDBClusterCommandError = async (
46314631
case "GlobalClusterNotFoundFault":
46324632
case "com.amazonaws.rds#GlobalClusterNotFoundFault":
46334633
throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context);
4634+
case "InsufficientDBInstanceCapacity":
4635+
case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault":
4636+
throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context);
46344637
case "InsufficientStorageClusterCapacity":
46354638
case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault":
46364639
throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context);

codegen/sdk-codegen/aws-models/rds.json

+91
Original file line numberDiff line numberDiff line change
@@ -3870,6 +3870,9 @@
38703870
{
38713871
"target": "com.amazonaws.rds#GlobalClusterNotFoundFault"
38723872
},
3873+
{
3874+
"target": "com.amazonaws.rds#InsufficientDBInstanceCapacityFault"
3875+
},
38733876
{
38743877
"target": "com.amazonaws.rds#InsufficientStorageClusterCapacityFault"
38753878
},
@@ -3958,6 +3961,57 @@
39583961
"CopyTagsToSnapshot": false
39593962
}
39603963
}
3964+
},
3965+
{
3966+
"title": "To create a PostgreSQL-compatible DB cluster",
3967+
"documentation": "The following example creates a PostgreSQL-compatible Aurora DB cluster.",
3968+
"input": {
3969+
"DBClusterIdentifier": "sample-pg-cluster",
3970+
"Engine": "aurora-postgresql",
3971+
"MasterUsername": "admin",
3972+
"MasterUserPassword": "mypassword",
3973+
"VpcSecurityGroupIds": ["sg-0b91305example"],
3974+
"DBSubnetGroupName": "default"
3975+
},
3976+
"output": {
3977+
"DBCluster": {
3978+
"Endpoint": "sample-pg-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
3979+
"HttpEndpointEnabled": false,
3980+
"DBClusterMembers": [],
3981+
"EngineMode": "provisioned",
3982+
"CopyTagsToSnapshot": false,
3983+
"HostedZoneId": "Z2R2ITUGPM61AM",
3984+
"IAMDatabaseAuthenticationEnabled": false,
3985+
"AllocatedStorage": 1,
3986+
"VpcSecurityGroups": [
3987+
{
3988+
"VpcSecurityGroupId": "sg-0b91305example",
3989+
"Status": "active"
3990+
}
3991+
],
3992+
"DeletionProtection": false,
3993+
"StorageEncrypted": false,
3994+
"BackupRetentionPeriod": 1,
3995+
"PreferredBackupWindow": "09:56-10:26",
3996+
"ClusterCreateTime": "2019-06-07T23:26:08.371Z",
3997+
"DBClusterParameterGroup": "default.aurora-postgresql9.6",
3998+
"EngineVersion": "9.6.9",
3999+
"Engine": "aurora-postgresql",
4000+
"Status": "creating",
4001+
"DBClusterIdentifier": "sample-pg-cluster",
4002+
"MultiAZ": false,
4003+
"Port": 5432,
4004+
"DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-pg-cluster",
4005+
"AssociatedRoles": [],
4006+
"DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE",
4007+
"PreferredMaintenanceWindow": "wed:03:33-wed:04:03",
4008+
"ReaderEndpoint": "sample-pg-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com",
4009+
"MasterUsername": "master",
4010+
"AvailabilityZones": ["us-east-1a", "us-east-1b", "us-east-1c"],
4011+
"ReadReplicaIdentifiers": [],
4012+
"DBSubnetGroup": "default"
4013+
}
4014+
}
39614015
}
39624016
]
39634017
}
@@ -13167,6 +13221,23 @@
1316713221
}
1316813222
]
1316913223
}
13224+
},
13225+
{
13226+
"title": "To describe DB cluster endpoints of a single DB cluster",
13227+
"documentation": "The following example retrieves details for the DB cluster endpoints of a single specified DB cluster. Aurora Serverless clusters have only a single endpoint with a type of WRITER.",
13228+
"input": {
13229+
"DBClusterIdentifier": "serverless-cluster"
13230+
},
13231+
"output": {
13232+
"DBClusterEndpoints": [
13233+
{
13234+
"Status": "available",
13235+
"Endpoint": "serverless-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
13236+
"DBClusterIdentifier": "serverless-cluster",
13237+
"EndpointType": "WRITER"
13238+
}
13239+
]
13240+
}
1317013241
}
1317113242
],
1317213243
"smithy.api#paginated": {
@@ -22060,6 +22131,26 @@
2206022131
]
2206122132
}
2206222133
}
22134+
},
22135+
{
22136+
"title": "To prevent an AWS account from restoring a DB snapshot",
22137+
"documentation": "The following example removes permission from the AWS account with the identifier 444455556666 to restore the DB snapshot named mydbsnapshot.",
22138+
"input": {
22139+
"DBSnapshotIdentifier": "mydbsnapshot",
22140+
"AttributeName": "restore",
22141+
"ValuesToRemove": ["444455556666"]
22142+
},
22143+
"output": {
22144+
"DBSnapshotAttributesResult": {
22145+
"DBSnapshotIdentifier": "mydbsnapshot",
22146+
"DBSnapshotAttributes": [
22147+
{
22148+
"AttributeName": "restore",
22149+
"AttributeValues": ["111122223333"]
22150+
}
22151+
]
22152+
}
22153+
}
2206322154
}
2206422155
]
2206522156
}

0 commit comments

Comments
 (0)