Skip to main content

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


Download files

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

Source Distribution

resoto-plugin-cleanup-untagged-3.2.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file resoto-plugin-cleanup-untagged-3.2.2.tar.gz.

File metadata

File hashes

Hashes for resoto-plugin-cleanup-untagged-3.2.2.tar.gz
Algorithm Hash digest
SHA256 1d132a324a3526a6acd2da89e1e9069e8a90065544d83b26a969a0ad4ee5a0ba
MD5 d28d6e5618fc0fc2f973dcd9f152e5ad
BLAKE2b-256 4f755ac5e40be5b60ee2970418030897b633fe2a2c72bd2f550056b55d353155

See more details on using hashes here.

File details

Details for the file resoto_plugin_cleanup_untagged-3.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for resoto_plugin_cleanup_untagged-3.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14cd6ebfa4eab8c65f5f2498f317436f1db27ec61deeb4c685070de5dda2f6f9
MD5 5d92c421eb2a942a0863d6cbe58ec86b
BLAKE2b-256 f64691674269bfccae6b5a5a42920cd6a039766d6434ac5068fa2e521c7b9cff

See more details on using hashes here.

Supported by

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