Deletes the specified VPC. :param vpc_id: The ID of the VPC to delete.
(self, vpc_id: str)
| 135 | |
| 136 | # snippet-start:[python.example_code.ec2.DeleteVpc] |
| 137 | def delete(self, vpc_id: str) -> None: |
| 138 | """ |
| 139 | Deletes the specified VPC. |
| 140 | |
| 141 | :param vpc_id: The ID of the VPC to delete. |
| 142 | """ |
| 143 | try: |
| 144 | self.ec2_client.delete_vpc(VpcId=vpc_id) |
| 145 | except ClientError as err: |
| 146 | logger.error( |
| 147 | "Couldn't delete VPC %s. Here's why: %s: %s", |
| 148 | vpc_id, |
| 149 | err.response["Error"]["Code"], |
| 150 | err.response["Error"]["Message"], |
| 151 | ) |
| 152 | raise |
| 153 | |
| 154 | # snippet-end:[python.example_code.ec2.DeleteVpc] |
| 155 |
no outgoing calls