Overview

Each badge is a key-value pair. For example, one badge might have a key of “fruit” and a value of “apple”.

When first added to an account, every cloud is automatically given two badges: divvy.cloud_type and divvy.resource_type. These, and any badge beginning with “divvy.”, are special system badges. No user-specified badge may begin with “divvy.”

Filtering Clouds With Badges

To filter your list of clouds by badge, navigate to the Clouds section of the site and click on the “Search Badge(s)” text box.

../_images/overview5.png

A drop-down list will appear. Select the badges which you want to match in your list of clouds.

../_images/overview6.png

By default, results shown match at least one badge in your provided criteria. To show only those results which match all selected badges, check the “Must Have All Badges” checkbox.

../_images/overview7.png

Adding/Removing Badges

To add/remove a badge to/from a cloud, navigate to the “Clouds” page in your account from the left-hand menu, and then find the “# Badges” column for the cloud to/from which you want to add/remove badges. Click on the number in that column.

../_images/overview0.png

The “Add Cloud Badges” dialog window will appear. In this dialog, click the plus icon (+) to create a line for your new badge.

../_images/overview1.png

In the new, blank space, add the name of your new badge. Badge names have no restrictions except that they may not begin with the string divvy. Both badge keys and badge values are case-sensitive. Repeat this process for as many new badges as you like.

../_images/overview2.png

To remove any user-created badges, click the minus icon (-) next to each entry you wish to remove.

../_images/overview3.png

When you are finished adding and removing badges, click the “SUBMIT” button to save your changes.

../_images/overview4.png

Badges in Messages

You can also use this information in messages. For example, you could use the following message, which uses Jinja2 templating and Slack formatting, to send an alert via Slack when a resource is created without tags mandated by policy. Suppose a given cloud has a tag of owner: jane.doe@acme.com. Then the value returned in the example below for {{event.resource.get_badge_value_by_key_for_parent_cloud('owner')}} will be jane.doe@acme.com.

A resource of type `{{event.resource.get_resource_type()}}` was discovered
at `{{event.resource.common.creation_timestamp}}` without the required _owner_
or _contact-email_ tags. The resource name is `{{event.resource.get_resource_name()}}`.
It lives in account `{{event.resource. get_organization_service_name()}}`,
which is owned by {{event.resource.get_badge_value_by_key_for_parent_cloud('owner')}}`.\n---