MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / delete

Method delete

python/example_code/ec2/vpc.py:137–152  ·  view source on GitHub ↗

Deletes the specified VPC. :param vpc_id: The ID of the VPC to delete.

(self, vpc_id: str)

Source from the content-addressed store, hash-verified

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

Callers 15

test_deleteFunction · 0.95
finFunction · 0.45
destroyFunction · 0.45
poll_notificationMethod · 0.45
usage_demoFunction · 0.45
destroyMethod · 0.45
usage_demoFunction · 0.45
usage_demoFunction · 0.45
delete_tableMethod · 0.45
delete_tableMethod · 0.45
delete_dax_tableFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_deleteFunction · 0.76