protector
Infrastructure App
This infrastructure app protects important resources from deletion by Fix Inventory.
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
Upon installation, Fix Inventory will create a config fix.apps.protector
.
Configuration​
-
Execute the following command in Fix Inventory Shell to open the infrastructure app configuration for editing:
> config edit fix.apps.protector
-
Update the configuration:
protector configurationconfig:
aws:
'110465657741':
us-east-1:
aws_ec2_instance:
- 'i-0fcbe8974615bfd37'infoThe 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
Add the optional --dry-run
flag to see what commands the app would perform, without actually executing them.