Skip to main content
Version: 2.4.1

Resource Tagging

Resoto 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, Resoto 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. Resoto 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.

Tag resource with an owner
> search is(aws_ec2_instance) and name = jenkins-master | tag update owner jenkins
Find resources that are missing the owner tag
> search tags.owner = null
Tag all resources missing the owner tag with a default owner
> search tags.owner = null | tag update owner "default owner"
Tag all instances missing the owner tag with an owner that corresponds to the account name
> 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 Resoto Shell, Resoto 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.