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-3.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa561b2005ec5310745715c1d20adc30ff70d0044d5611dd60c8556bd7e3b985 |
|
MD5 | 2b5d765e8f512db68e51737618c10a6e |
|
BLAKE2b-256 | 38962fce24e2116496b797657f591f28eaca5c25e1bb3a07cd7eea835d5e8ca9 |
Hashes for resoto_plugin_cleanup_untagged-3.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5823fd9426e6d30f4c371702c22858146e49bcd31623a5a49e2e8b5a1c660561 |
|
MD5 | 4d23968349005fd91acb0bd6f6b504e3 |
|
BLAKE2b-256 | fc7173adc07fd634b3a6e3bb98e3b2c296c488b92f4a456ffc4bc388c25b5e8d |