Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

b3d-0.1.7.tar.gz (18.0 kB view hashes)

Uploaded Source

Built Distribution

b3d-0.1.7-py3-none-any.whl (25.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page