- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ModifyDBSubnetGroupCommand
Modifies an existing subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DocDBClient, ModifyDBSubnetGroupCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, ModifyDBSubnetGroupCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // ModifyDBSubnetGroupMessage
DBSubnetGroupName: "STRING_VALUE", // required
DBSubnetGroupDescription: "STRING_VALUE",
SubnetIds: [ // SubnetIdentifierList // required
"STRING_VALUE",
],
};
const command = new ModifyDBSubnetGroupCommand(input);
const response = await client.send(command);
// { // ModifyDBSubnetGroupResult
// DBSubnetGroup: { // DBSubnetGroup
// DBSubnetGroupName: "STRING_VALUE",
// DBSubnetGroupDescription: "STRING_VALUE",
// VpcId: "STRING_VALUE",
// SubnetGroupStatus: "STRING_VALUE",
// Subnets: [ // SubnetList
// { // Subnet
// SubnetIdentifier: "STRING_VALUE",
// SubnetAvailabilityZone: { // AvailabilityZone
// Name: "STRING_VALUE",
// },
// SubnetStatus: "STRING_VALUE",
// },
// ],
// DBSubnetGroupArn: "STRING_VALUE",
// },
// };
ModifyDBSubnetGroupCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DBSubnetGroupName Required | string | undefined | The name for the subnet group. This value is stored as a lowercase string. You can't modify the default subnet group. Constraints: Must match the name of an existing Example: |
SubnetIds Required | string[] | undefined | The Amazon EC2 subnet IDs for the subnet group. |
DBSubnetGroupDescription | string | undefined | The description for the subnet group. |
ModifyDBSubnetGroupCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DBSubnetGroup | DBSubnetGroup | undefined | Detailed information about a subnet group. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DBSubnetGroupDoesNotCoverEnoughAZs | client | Subnets in the subnet group should cover at least two Availability Zones unless there is only one Availability Zone. |
DBSubnetGroupNotFoundFault | client | |
DBSubnetQuotaExceededFault | client | The request would cause you to exceed the allowed number of subnets in a subnet group. |
InvalidSubnet | client | The requested subnet is not valid, or multiple subnets were requested that are not all in a common virtual private cloud (VPC). |
SubnetAlreadyInUse | client | The subnet is already in use in the Availability Zone. |
DocDBServiceException | Base exception class for all service exceptions from DocDB service. |