Skip to main content

protector Infrastructure App

This infrastructure app protects important resources from deletion by Fix Inventory.

info

Each Fix Inventory resource has a boolean attribute /metadata.protected. By default, its value is false.

Each Fix Inventory resource inherits BaseResource, which contains two methods for cleaning up a resource, cleanup() and delete(). Both methods will refuse to manipulate a resource if the /metadata.protected attribute is set to true, meaning that protected resources flagged for cleanup will not be deleted.

Installation​

> app install protector
info

Upon installation, Fix Inventory will create a config fix.apps.protector.

Configuration​

  1. Execute the following command in Fix Inventory Shell to open the infrastructure app configuration for editing:

    > config edit fix.apps.protector
  2. Update the configuration:

    protector configuration
    config:
    aws:
    '110465657741':
    us-east-1:
    aws_ec2_instance:
    - 'i-0fcbe8974615bfd37'
    info

    The format of the config section is as follows:

    cloud.id:
    account.id:
    region.id:
    kind:
    - resource.id

Usage​

Run the app using the app run command:

> app run protector
tip

Add the optional --dry-run flag to see what commands the app would perform, without actually executing them.

Further Reading​