Metadata-Version: 2.1
Name: b3d
Version: 0.1.0
Summary: Boto3 utility library that supports deletion of collections of AWS resources (such as temporary resources created during unit tests).
Author: Ben Getchell
Author-email: bengetch@gmail.com
License: MIT License
        
        Copyright (c) 2021 Nth Party, Ltd.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/nthparty/b3d
Project-URL: repository, https://github.com/nthparty/b3d
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: publish
License-File: LICENSE

# 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: 

```python
from b3d import delete_resources

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

# reports list might look like:
# [
#   {'result': 'success', 'err': None, 'msg': 'Successfully deleted api-key with ID zdmz8ysque'}, 
#   {'result': 'success', 'err': None, 'msg': 'Successfully deleted api-key with ID qwv83b4pj5'}
# ]
```

The returned `reports` will be a list of all resources affected by the deletion procedure, the type of action
performed (e.g. detachment from another resource, deletion), and whether that action was successful, along with
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 are skipped. The same reports list will be produced, but the resources themselves will
be unaffected.
