Skip to content

Commit

Permalink
feat(client-rds): Support ComputeRedundancy parameter in ModifyDBShar…
Browse files Browse the repository at this point in the history
…dGroup API. Add DBShardGroupArn in DBShardGroup API response. Remove InvalidMaxAcuFault from CreateDBShardGroup and ModifyDBShardGroup API. Both API will throw InvalidParameterValueException for invalid ACU configuration.
  • Loading branch information
awstools committed Sep 23, 2024
1 parent f6a2631 commit f69b00e
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 117 deletions.
4 changes: 1 addition & 3 deletions clients/client-rds/src/commands/CreateDBShardGroupCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface CreateDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* // Status: "STRING_VALUE",
* // PubliclyAccessible: true || false,
* // Endpoint: "STRING_VALUE",
* // DBShardGroupArn: "STRING_VALUE",
* // };
*
* ```
Expand All @@ -76,9 +77,6 @@ export interface CreateDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* @throws {@link InvalidDBClusterStateFault} (client fault)
* <p>The requested operation can't be performed while the cluster is in this state.</p>
*
* @throws {@link InvalidMaxAcuFault} (client fault)
* <p>The maximum capacity of the DB shard group must be 48-7168 Aurora capacity units (ACUs).</p>
*
* @throws {@link InvalidVPCNetworkStateFault} (client fault)
* <p>The DB subnet group doesn't cover all Availability Zones after it's
* created because of users' change.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface DeleteDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* // Status: "STRING_VALUE",
* // PubliclyAccessible: true || false,
* // Endpoint: "STRING_VALUE",
* // DBShardGroupArn: "STRING_VALUE",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { DeleteTenantDatabaseMessage } from "../models/models_0";
import { DeleteTenantDatabaseResult, DeleteTenantDatabaseResultFilterSensitiveLog } from "../models/models_1";
import {
DeleteTenantDatabaseMessage,
DeleteTenantDatabaseResult,
DeleteTenantDatabaseResultFilterSensitiveLog,
} from "../models/models_0";
import { de_DeleteTenantDatabaseCommand, se_DeleteTenantDatabaseCommand } from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface DescribeDBShardGroupsCommandOutput extends DescribeDBShardGroup
* // Status: "STRING_VALUE",
* // PubliclyAccessible: true || false,
* // Endpoint: "STRING_VALUE",
* // DBShardGroupArn: "STRING_VALUE",
* // },
* // ],
* // Marker: "STRING_VALUE",
Expand Down
5 changes: 2 additions & 3 deletions clients/client-rds/src/commands/ModifyDBShardGroupCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface ModifyDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* DBShardGroupIdentifier: "STRING_VALUE", // required
* MaxACU: Number("double"),
* MinACU: Number("double"),
* ComputeRedundancy: Number("int"),
* };
* const command = new ModifyDBShardGroupCommand(input);
* const response = await client.send(command);
Expand All @@ -54,6 +55,7 @@ export interface ModifyDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* // Status: "STRING_VALUE",
* // PubliclyAccessible: true || false,
* // Endpoint: "STRING_VALUE",
* // DBShardGroupArn: "STRING_VALUE",
* // };
*
* ```
Expand All @@ -73,9 +75,6 @@ export interface ModifyDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* @throws {@link InvalidDBClusterStateFault} (client fault)
* <p>The requested operation can't be performed while the cluster is in this state.</p>
*
* @throws {@link InvalidMaxAcuFault} (client fault)
* <p>The maximum capacity of the DB shard group must be 48-7168 Aurora capacity units (ACUs).</p>
*
* @throws {@link RDSServiceException}
* <p>Base exception class for all service exceptions from RDS service.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface RebootDBShardGroupCommandOutput extends DBShardGroup, __Metadat
* // Status: "STRING_VALUE",
* // PubliclyAccessible: true || false,
* // Endpoint: "STRING_VALUE",
* // DBShardGroupArn: "STRING_VALUE",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface RestoreDBInstanceFromDBSnapshotCommandOutput
* must be the ARN of the shared DB snapshot.</p>
* <p>To restore from a DB snapshot with an unsupported engine version, you must first upgrade the
* engine version of the snapshot. For more information about upgrading a RDS for MySQL DB snapshot engine version, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql-upgrade-snapshot.html">Upgrading a MySQL DB snapshot engine version</a>.
* For more information about upgrading a RDS for PostgreSQL DB snapshot engine version, <a href="https://docs.aws.amazon.com/USER_UpgradeDBSnapshot.PostgreSQL.html">Upgrading a PostgreSQL DB snapshot engine version</a>.</p>
* For more information about upgrading a RDS for PostgreSQL DB snapshot engine version, <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBSnapshot.PostgreSQL.html">Upgrading a PostgreSQL DB snapshot engine version</a>.</p>
* <note>
* <p>This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, use <code>RestoreDBClusterFromSnapshot</code>.</p>
* </note>
Expand Down
78 changes: 46 additions & 32 deletions clients/client-rds/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9936,12 +9936,20 @@ export interface CreateDBInstanceReadReplicaMessage {
OptionGroupName?: string;

/**
* <p>The name of the DB parameter group to associate with this DB instance.</p>
* <p>If you don't specify a value for <code>DBParameterGroupName</code>, then Amazon RDS
* uses the <code>DBParameterGroup</code> of the source DB instance for a same Region read
* <p>The name of the DB parameter group to associate with this read replica DB
* instance.</p>
* <p>For Single-AZ or Multi-AZ DB instance read replica instances, if you don't specify a
* value for <code>DBParameterGroupName</code>, then Amazon RDS uses the
* <code>DBParameterGroup</code> of the source DB instance for a same Region read
* replica, or the default <code>DBParameterGroup</code> for the specified DB engine for a
* cross-Region read replica.</p>
* <p>Specifying a parameter group for this operation is only supported for MySQL DB instances for cross-Region read replicas and for Oracle DB instances. It isn't supported for MySQL DB instances for same Region read replicas or for RDS Custom.</p>
* <p>For Multi-AZ DB cluster same Region read replica instances, if you don't specify a
* value for <code>DBParameterGroupName</code>, then Amazon RDS uses the default
* <code>DBParameterGroup</code>.</p>
* <p>Specifying a parameter group for this operation is only supported for MySQL DB
* instances for cross-Region read replicas, for Multi-AZ DB cluster read replica
* instances, and for Oracle DB instances. It isn't supported for MySQL DB instances for
* same Region read replicas or for RDS Custom.</p>
* <p>Constraints:</p>
* <ul>
* <li>
Expand Down Expand Up @@ -11433,16 +11441,16 @@ export interface CreateDBShardGroupMessage {
DBClusterIdentifier: string | undefined;

/**
* <p>Specifies whether to create standby instances for the DB shard group. Valid values are the following:</p>
* <p>Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following:</p>
* <ul>
* <li>
* <p>0 - Creates a single, primary DB instance for each physical shard. This is the default value, and the only one supported for the preview.</p>
* <p>0 - Creates a DB shard group without a standby DB shard group. This is the default value.</p>
* </li>
* <li>
* <p>1 - Creates a primary DB instance and a standby instance in a different Availability Zone (AZ) for each physical shard.</p>
* <p>1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ).</p>
* </li>
* <li>
* <p>2 - Creates a primary DB instance and two standby instances in different AZs for each physical shard.</p>
* <p>2 - Creates a DB shard group with two standby DB shard groups in two different AZs.</p>
* </li>
* </ul>
* @public
Expand Down Expand Up @@ -11527,16 +11535,16 @@ export interface DBShardGroup {
MinACU?: number;

/**
* <p>Specifies whether to create standby instances for the DB shard group. Valid values are the following:</p>
* <p>Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following:</p>
* <ul>
* <li>
* <p>0 - Creates a single, primary DB instance for each physical shard. This is the default value, and the only one supported for the preview.</p>
* <p>0 - Creates a DB shard group without a standby DB shard group. This is the default value.</p>
* </li>
* <li>
* <p>1 - Creates a primary DB instance and a standby instance in a different Availability Zone (AZ) for each physical shard.</p>
* <p>1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ).</p>
* </li>
* <li>
* <p>2 - Creates a primary DB instance and two standby instances in different AZs for each physical shard.</p>
* <p>2 - Creates a DB shard group with two standby DB shard groups in two different AZs.</p>
* </li>
* </ul>
* @public
Expand Down Expand Up @@ -11569,6 +11577,12 @@ export interface DBShardGroup {
* @public
*/
Endpoint?: string;

/**
* <p>The Amazon Resource Name (ARN) for the DB shard group.</p>
* @public
*/
DBShardGroupArn?: string;
}

/**
Expand All @@ -11591,26 +11605,6 @@ export class DBShardGroupAlreadyExistsFault extends __BaseException {
}
}

/**
* <p>The maximum capacity of the DB shard group must be 48-7168 Aurora capacity units (ACUs).</p>
* @public
*/
export class InvalidMaxAcuFault extends __BaseException {
readonly name: "InvalidMaxAcuFault" = "InvalidMaxAcuFault";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<InvalidMaxAcuFault, __BaseException>) {
super({
name: "InvalidMaxAcuFault",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, InvalidMaxAcuFault.prototype);
}
}

/**
* <p>The maximum number of DB shard groups for your Amazon Web Services account in the specified Amazon Web Services Region has been reached.</p>
* @public
Expand Down Expand Up @@ -14519,6 +14513,18 @@ export interface DeleteTenantDatabaseMessage {
FinalDBSnapshotIdentifier?: string;
}

/**
* @public
*/
export interface DeleteTenantDatabaseResult {
/**
* <p>A tenant database in the DB instance. This data type is an element in the response to
* the <code>DescribeTenantDatabases</code> action.</p>
* @public
*/
TenantDatabase?: TenantDatabase;
}

/**
* @internal
*/
Expand Down Expand Up @@ -14554,3 +14560,11 @@ export const CreateTenantDatabaseResultFilterSensitiveLog = (obj: CreateTenantDa
...obj,
...(obj.TenantDatabase && { TenantDatabase: TenantDatabaseFilterSensitiveLog(obj.TenantDatabase) }),
});

/**
* @internal
*/
export const DeleteTenantDatabaseResultFilterSensitiveLog = (obj: DeleteTenantDatabaseResult): any => ({
...obj,
...(obj.TenantDatabase && { TenantDatabase: TenantDatabaseFilterSensitiveLog(obj.TenantDatabase) }),
});
37 changes: 17 additions & 20 deletions clients/client-rds/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ import {

import { RDSServiceException as __BaseException } from "./RDSServiceException";

/**
* @public
*/
export interface DeleteTenantDatabaseResult {
/**
* <p>A tenant database in the DB instance. This data type is an element in the response to
* the <code>DescribeTenantDatabases</code> action.</p>
* @public
*/
TenantDatabase?: TenantDatabase;
}

/**
* <p>The specified RDS DB instance or Aurora DB cluster isn't available for a proxy owned by your Amazon Web Services account in the specified Amazon Web Services Region.</p>
* @public
Expand Down Expand Up @@ -9717,6 +9705,23 @@ export interface ModifyDBShardGroupMessage {
* @public
*/
MinACU?: number;

/**
* <p>Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following:</p>
* <ul>
* <li>
* <p>0 - Creates a DB shard group without a standby DB shard group. This is the default value.</p>
* </li>
* <li>
* <p>1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ).</p>
* </li>
* <li>
* <p>2 - Creates a DB shard group with two standby DB shard groups in two different AZs.</p>
* </li>
* </ul>
* @public
*/
ComputeRedundancy?: number;
}

/**
Expand Down Expand Up @@ -15139,14 +15144,6 @@ export interface SwitchoverReadReplicaResult {
DBInstance?: DBInstance;
}

/**
* @internal
*/
export const DeleteTenantDatabaseResultFilterSensitiveLog = (obj: DeleteTenantDatabaseResult): any => ({
...obj,
...(obj.TenantDatabase && { TenantDatabase: TenantDatabaseFilterSensitiveLog(obj.TenantDatabase) }),
});

/**
* @internal
*/
Expand Down
37 changes: 8 additions & 29 deletions clients/client-rds/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ import {
DeleteIntegrationMessage,
DeleteOptionGroupMessage,
DeleteTenantDatabaseMessage,
DeleteTenantDatabaseResult,
DomainMembership,
DomainNotFoundFault,
Ec2ImagePropertiesNotSupportedFault,
Expand Down Expand Up @@ -765,7 +766,6 @@ import {
InvalidExportTaskStateFault,
InvalidGlobalClusterStateFault,
InvalidIntegrationStateFault,
InvalidMaxAcuFault,
InvalidOptionGroupStateFault,
InvalidSubnet,
InvalidVPCNetworkStateFault,
Expand Down Expand Up @@ -867,7 +867,6 @@ import {
DBSnapshotTenantDatabasesMessage,
DBSubnetGroupMessage,
DBUpgradeDependencyFailureFault,
DeleteTenantDatabaseResult,
DeregisterDBProxyTargetsRequest,
DeregisterDBProxyTargetsResponse,
DescribeAccountAttributesMessage,
Expand Down Expand Up @@ -7332,9 +7331,6 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "DBShardGroupAlreadyExists":
case "com.amazonaws.rds#DBShardGroupAlreadyExistsFault":
throw await de_DBShardGroupAlreadyExistsFaultRes(parsedOutput, context);
case "InvalidMaxAcu":
case "com.amazonaws.rds#InvalidMaxAcuFault":
throw await de_InvalidMaxAcuFaultRes(parsedOutput, context);
case "MaxDBShardGroupLimitReached":
case "com.amazonaws.rds#MaxDBShardGroupLimitReached":
throw await de_MaxDBShardGroupLimitReachedRes(parsedOutput, context);
Expand Down Expand Up @@ -9227,19 +9223,6 @@ const de_InvalidIntegrationStateFaultRes = async (
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_queryInvalidMaxAcuFaultRes
*/
const de_InvalidMaxAcuFaultRes = async (parsedOutput: any, context: __SerdeContext): Promise<InvalidMaxAcuFault> => {
const body = parsedOutput.body;
const deserialized: any = de_InvalidMaxAcuFault(body.Error, context);
const exception = new InvalidMaxAcuFault({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_queryInvalidOptionGroupStateFaultRes
*/
Expand Down Expand Up @@ -14177,6 +14160,9 @@ const se_ModifyDBShardGroupMessage = (input: ModifyDBShardGroupMessage, context:
if (input[_MACUi] != null) {
entries[_MACUi] = __serializeFloat(input[_MACUi]);
}
if (input[_CR] != null) {
entries[_CR] = input[_CR];
}
return entries;
};

Expand Down Expand Up @@ -19786,6 +19772,9 @@ const de_DBShardGroup = (output: any, context: __SerdeContext): DBShardGroup =>
if (output[_End] != null) {
contents[_End] = __expectString(output[_End]);
}
if (output[_DBSGAh] != null) {
contents[_DBSGAh] = __expectString(output[_DBSGAh]);
}
return contents;
};

Expand Down Expand Up @@ -21919,17 +21908,6 @@ const de_InvalidIntegrationStateFault = (output: any, context: __SerdeContext):
return contents;
};

/**
* deserializeAws_queryInvalidMaxAcuFault
*/
const de_InvalidMaxAcuFault = (output: any, context: __SerdeContext): InvalidMaxAcuFault => {
const contents: any = {};
if (output[_m] != null) {
contents[_m] = __expectString(output[_m]);
}
return contents;
};

/**
* deserializeAws_queryInvalidOptionGroupStateFault
*/
Expand Down Expand Up @@ -25164,6 +25142,7 @@ const _DBSAn = "DBSnapshotAttributes";
const _DBSAna = "DBSnapshotAttribute";
const _DBSG = "DBSecurityGroups";
const _DBSGA = "DBSecurityGroupArn";
const _DBSGAh = "DBShardGroupArn";
const _DBSGAu = "DBSubnetGroupArn";
const _DBSGD = "DBSecurityGroupDescription";
const _DBSGDu = "DBSubnetGroupDescription";
Expand Down
Loading

0 comments on commit f69b00e

Please sign in to comment.