Skip to content

Commit

Permalink
feat(client-rds): Introduced support for the InsufficientDBInstanceCa…
Browse files Browse the repository at this point in the history
…pacityFault 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.
  • Loading branch information
awstools committed Jan 22, 2024
1 parent 8ceeeff commit 549616d
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 21 deletions.
4 changes: 4 additions & 0 deletions clients/client-rds/src/commands/CreateDBClusterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ export interface CreateDBClusterCommandOutput extends CreateDBClusterResult, __M
* @throws {@link GlobalClusterNotFoundFault} (client fault)
* <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster.</p>
*
* @throws {@link InsufficientDBInstanceCapacityFault} (client fault)
* <p>The specified DB instance class isn't available in the specified Availability
* Zone.</p>
*
* @throws {@link InsufficientStorageClusterCapacityFault} (client fault)
* <p>There is insufficient storage available for the current action. You might be able to
* resolve this error by updating your subnet group to use different Availability Zones
Expand Down
42 changes: 21 additions & 21 deletions clients/client-rds/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6244,6 +6244,27 @@ export class GlobalClusterNotFoundFault extends __BaseException {
}
}

/**
* @public
* <p>The specified DB instance class isn't available in the specified Availability
* Zone.</p>
*/
export class InsufficientDBInstanceCapacityFault extends __BaseException {
readonly name: "InsufficientDBInstanceCapacityFault" = "InsufficientDBInstanceCapacityFault";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<InsufficientDBInstanceCapacityFault, __BaseException>) {
super({
name: "InsufficientDBInstanceCapacityFault",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, InsufficientDBInstanceCapacityFault.prototype);
}
}

/**
* @public
* <p>There is insufficient storage available for the current action. You might be able to
Expand Down Expand Up @@ -9422,27 +9443,6 @@ export class DBInstanceAlreadyExistsFault extends __BaseException {
}
}

/**
* @public
* <p>The specified DB instance class isn't available in the specified Availability
* Zone.</p>
*/
export class InsufficientDBInstanceCapacityFault extends __BaseException {
readonly name: "InsufficientDBInstanceCapacityFault" = "InsufficientDBInstanceCapacityFault";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<InsufficientDBInstanceCapacityFault, __BaseException>) {
super({
name: "InsufficientDBInstanceCapacityFault",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, InsufficientDBInstanceCapacityFault.prototype);
}
}

/**
* @public
* <p>The network type is invalid for the DB instance. Valid nework type values are <code>IPV4</code> and <code>DUAL</code>.</p>
Expand Down
3 changes: 3 additions & 0 deletions clients/client-rds/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4631,6 +4631,9 @@ const de_CreateDBClusterCommandError = async (
case "GlobalClusterNotFoundFault":
case "com.amazonaws.rds#GlobalClusterNotFoundFault":
throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context);
case "InsufficientDBInstanceCapacity":
case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault":
throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context);
case "InsufficientStorageClusterCapacity":
case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault":
throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context);
Expand Down
91 changes: 91 additions & 0 deletions codegen/sdk-codegen/aws-models/rds.json
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,9 @@
{
"target": "com.amazonaws.rds#GlobalClusterNotFoundFault"
},
{
"target": "com.amazonaws.rds#InsufficientDBInstanceCapacityFault"
},
{
"target": "com.amazonaws.rds#InsufficientStorageClusterCapacityFault"
},
Expand Down Expand Up @@ -3958,6 +3961,57 @@
"CopyTagsToSnapshot": false
}
}
},
{
"title": "To create a PostgreSQL-compatible DB cluster",
"documentation": "The following example creates a PostgreSQL-compatible Aurora DB cluster.",
"input": {
"DBClusterIdentifier": "sample-pg-cluster",
"Engine": "aurora-postgresql",
"MasterUsername": "admin",
"MasterUserPassword": "mypassword",
"VpcSecurityGroupIds": ["sg-0b91305example"],
"DBSubnetGroupName": "default"
},
"output": {
"DBCluster": {
"Endpoint": "sample-pg-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
"HttpEndpointEnabled": false,
"DBClusterMembers": [],
"EngineMode": "provisioned",
"CopyTagsToSnapshot": false,
"HostedZoneId": "Z2R2ITUGPM61AM",
"IAMDatabaseAuthenticationEnabled": false,
"AllocatedStorage": 1,
"VpcSecurityGroups": [
{
"VpcSecurityGroupId": "sg-0b91305example",
"Status": "active"
}
],
"DeletionProtection": false,
"StorageEncrypted": false,
"BackupRetentionPeriod": 1,
"PreferredBackupWindow": "09:56-10:26",
"ClusterCreateTime": "2019-06-07T23:26:08.371Z",
"DBClusterParameterGroup": "default.aurora-postgresql9.6",
"EngineVersion": "9.6.9",
"Engine": "aurora-postgresql",
"Status": "creating",
"DBClusterIdentifier": "sample-pg-cluster",
"MultiAZ": false,
"Port": 5432,
"DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-pg-cluster",
"AssociatedRoles": [],
"DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE",
"PreferredMaintenanceWindow": "wed:03:33-wed:04:03",
"ReaderEndpoint": "sample-pg-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com",
"MasterUsername": "master",
"AvailabilityZones": ["us-east-1a", "us-east-1b", "us-east-1c"],
"ReadReplicaIdentifiers": [],
"DBSubnetGroup": "default"
}
}
}
]
}
Expand Down Expand Up @@ -13167,6 +13221,23 @@
}
]
}
},
{
"title": "To describe DB cluster endpoints of a single DB cluster",
"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.",
"input": {
"DBClusterIdentifier": "serverless-cluster"
},
"output": {
"DBClusterEndpoints": [
{
"Status": "available",
"Endpoint": "serverless-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
"DBClusterIdentifier": "serverless-cluster",
"EndpointType": "WRITER"
}
]
}
}
],
"smithy.api#paginated": {
Expand Down Expand Up @@ -22060,6 +22131,26 @@
]
}
}
},
{
"title": "To prevent an AWS account from restoring a DB snapshot",
"documentation": "The following example removes permission from the AWS account with the identifier 444455556666 to restore the DB snapshot named mydbsnapshot.",
"input": {
"DBSnapshotIdentifier": "mydbsnapshot",
"AttributeName": "restore",
"ValuesToRemove": ["444455556666"]
},
"output": {
"DBSnapshotAttributesResult": {
"DBSnapshotIdentifier": "mydbsnapshot",
"DBSnapshotAttributes": [
{
"AttributeName": "restore",
"AttributeValues": ["111122223333"]
}
]
}
}
}
]
}
Expand Down

0 comments on commit 549616d

Please sign in to comment.