Created
July 5, 2017 06:37
-
-
Save nguyendv/b2aceeedf465eeee8381a8873cfbb7e3 to your computer and use it in GitHub Desktop.
Using boto3 to delete AWS resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Terminate instance | |
instance = ec2.Instance(instances_id) | |
instance.terminate() | |
# delete sec group | |
sec_group2 = ec2.SecurityGroup(sec_group_id) | |
sec_group2.delete() | |
# delete subnet | |
subnet2 = ec2.Subnet(subnet_id) | |
subnet2.delete() | |
# delete vpc | |
vpc2 = ec2.Vpc(vpc_id) | |
vpc2.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment