- 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.
DisassociateSubnetCidrBlockCommand
Disassociates a CIDR block from a subnet. Currently, you can disassociate an IPv6 CIDR block only. You must detach or delete all gateways and resources that are associated with the CIDR block before you can disassociate it.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, DisassociateSubnetCidrBlockCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DisassociateSubnetCidrBlockCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DisassociateSubnetCidrBlockRequest
AssociationId: "STRING_VALUE", // required
};
const command = new DisassociateSubnetCidrBlockCommand(input);
const response = await client.send(command);
// { // DisassociateSubnetCidrBlockResult
// Ipv6CidrBlockAssociation: { // SubnetIpv6CidrBlockAssociation
// AssociationId: "STRING_VALUE",
// Ipv6CidrBlock: "STRING_VALUE",
// Ipv6CidrBlockState: { // SubnetCidrBlockState
// State: "associating" || "associated" || "disassociating" || "disassociated" || "failing" || "failed",
// StatusMessage: "STRING_VALUE",
// },
// Ipv6AddressAttribute: "public" || "private",
// IpSource: "amazon" || "byoip" || "none",
// },
// SubnetId: "STRING_VALUE",
// };
DisassociateSubnetCidrBlockCommand Input
See DisassociateSubnetCidrBlockCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AssociationId Required | string | undefined | The association ID for the CIDR block. |
DisassociateSubnetCidrBlockCommand Output
See DisassociateSubnetCidrBlockCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Ipv6CidrBlockAssociation | SubnetIpv6CidrBlockAssociation | undefined | Information about the IPv6 CIDR block association. |
SubnetId | string | undefined | The ID of the subnet. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
EC2ServiceException | Base exception class for all service exceptions from EC2 service. |