Resoto Cleanup Untagged Plugin
Project description
resoto-plugin-cleanup-untagged
Cleanup Untagged Plugin for Resoto
This plugin deletes cloud resources that are missing mandatory tags after a certain amount of time has passed since their creation.
Usage
In resh
execute
> config edit resoto.worker
and find the following section
plugin_cleanup_untagged:
# Configuration for the plugin
config:
default:
age: '2h'
tags:
- 'owner'
- 'expiration'
kinds:
- 'aws_ec2_instance'
- 'aws_ec2_volume'
- 'aws_vpc'
- 'aws_cloudformation_stack'
- 'aws_elb'
- 'aws_alb'
- 'aws_alb_target_group'
- 'aws_eks_cluster'
- 'aws_eks_nodegroup'
- 'example_instance'
- 'example_network'
accounts:
aws:
068564737731:
name: 'playground'
age: '7d'
'575584959047':
name: 'eng-sre'
example:
Example Account:
name: 'Example Account'
# Enable plugin?
enabled: false
Config section format
The config section consists of four sub-sections. default
, tags
, classes
and accounts
. The default
section specifies the default age
a resource must have before we enforce mandatory tags on it. For instance if age
is set to 2h
this means that whatever mechanism creates a resource has two hours to add those mandatory tags.
The tags
section is a list of tag names that MUST exist on every resource class specified in classes
. The classes
section is a list of resource class names for which tags specified in the tags
list must exist.
The accounts
section contains a dictionary with cloud IDs as keys (e.g. aws
) and account IDs for which tags will be enforced as values (e.g. 068564737731
). Those in turn contain a name
and optionally an age
override.
The following age units are valid:
weeks
days
hours
minutes
Each of them can be abbreviated down to one letter. E.g. 7d
, 24h
, 60m
, etc. A space in between the numeric and the unit is optional, meaning 7d
and 7 days
are equivalent.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for resoto-plugin-cleanup-untagged-2.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a39073e285bd7ed0d196d2195dc5537392ecc24c5355a1753d111e8d5efae4f |
|
MD5 | 163883b279a23dfb4bf5b8e2ff3ff3b5 |
|
BLAKE2b-256 | 9cfb8fde6c0668202594511e83046b523a47a78941eaac0280529b0c09105646 |
Hashes for resoto_plugin_cleanup_untagged-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52e96e4b8fad486df99d68576910d2e61b003a6f3c42f9b2309ed12d4378313 |
|
MD5 | afffa00e22a1c4a0c295d7b78c6e8250 |
|
BLAKE2b-256 | df23173c066e74abc4ce76926eab256a2ddc243ebd00bafca3758464ab9afa9a |