Skip to content
/ b3d Public

Boto3 utility library that supports deletion of collections of AWS resources (such as temporary resources created during unit tests).

License

Notifications You must be signed in to change notification settings

nthparty/b3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

b3d

Boto3 utility library that supports deletion of collections of AWS resources (such as temporary resources created during unit tests).

Usage

The function b3d.delete_resources is used to remove all AWS resources with a particular key / value tag pair. It can be called as follows:

from b3d import delete_resources

reports = delete_resources("tag_key", "tag_value", "aws_region_name", dry=False)

The delete_resources() function returns an iterator whose elements are lists of reports for each single resource. A list of reports is yielded (rather than an individual report) because a delete procedure might involve detaching any number of resources from the target resource first. Each report will detail the type of action performed (e.g. detachment from another resource, deletion, noop), whether that action was successful, and an error message if appropriate.

If dry=True, delete_resources will perform all the same queries on AWS resources, but all detach and delete operations will be skipped. The same reports list will therefore be produced, but the resources themselves will be unaffected.

About

Boto3 utility library that supports deletion of collections of AWS resources (such as temporary resources created during unit tests).

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •