Resource Tagging
Fix Inventory is able to create, update, and delete tags for resources that support tags.
Tags are key-value pairs that allow for the addition of arbitrary metadata to a resource. In clouds where tags are a list of strings, Fix Inventory encodes given values into the string using double dashes.
To tag resources, simply pipe the result of a search into the tag
command.
Concept​
Tags are a useful way to organize and categorize resources. Fix Inventory allows for very efficient tagging and tag validation of thousands of resources. You could have a tag called owner
indicating the owner of the resource.
> search is(aws_ec2_instance) and name = jenkins-master | tag update owner jenkins
> search tags.owner = null
> search tags.owner = null | tag update owner "default owner"
> search is(instance) and tags.owner = null | tag update owner {/ancestors.account.reported.name}
How Tagging Is Performed​
When a resource is tagged on the Fix Inventory Shell, Fix Inventory Core creates a tagging task that is dispatched to a Worker.
By default the tag
command waits for that task to complete and returns the result of the tagging operation (success/failure). If the --nowait
flag is given, the command will return immediately.