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

Parameter
Type
Description
AssociationId
Required
string | undefined

The association ID for the CIDR block.

DisassociateSubnetCidrBlockCommand Output

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
EC2ServiceException
Base exception class for all service exceptions from EC2 service.