terraform

New Workspace Tags for Terraform Cloud

HashiCorp Terraform Cloud gives you a quick and easy new way to search and filter workspaces based on tags.

Managing infrastructure as code at scale can be a challenge to many organizations. While HashiCorp Terraform Cloud provides organizations with a fast and easy way to adopt Terraform, managing workspaces can bring about obstacles requiring additional planning and visibility.

Earlier this year, we announced a new Overview page to give you a quick and easy-to-reference panel for all the important details of each particular workspace. Now, we are announcing workspace tags that give you an easier way to organize and filter your workspaces within the top-level workspaces page.

»Workspace Tags

Workspace tags, which are now available for both Terraform Cloud and Terraform Enterprise, bring additional contextual awareness to the workspace level. The usage of tags allows you to correlate, organize, and even filter workspaces based on the assigned tags.

The workspaces page, which lists all the available workspaces in an organization, now features the assigned tags next to their respective names. A “Filter by Tag” button is also available as an option. You can use the button to select one or multiple tags to isolate only those workspaces with the specified tags. The “Clear Filters” option will return you to the default list of workspaces. Your browser’s URL address bar will update so you can easily bookmark or share your filtered view with others.

Filtering workspaces by tags

The workspace overview page has been updated to provide an easy option to manage tags. There is an additional panel to create, assign, and remove tags through the “search for or create a new tag” dropdown box. Tag names are defined by a combination of alphanumeric characters and colons.

Additionally, the workspace overview page provides an option for you to interact with the assigned tags. Clicking a tag will take you to the top-level workspaces page, presenting a filtered view of only those workspaces which also are assigned that tag.

Adding a workspace tag

Administrators have the ability to delete tags at the organization level and en masse. The organization’s Settings panel has a subsection for tags as well. Here, you can select one or more tags to remove from the organization. Alternatively, managing tags are also available at the API level through the Organization Tags API and will soon be available in the TFE provider.

Tag management page

Tags also make themselves available in one other area. Sentinel, HashiCorp’s policy as code framework, can reference tags as part of the tfrundata. This allows you to be able to dynamically apply Sentinel policies based on whether or not a specific tag has been applied to a workspace. One such example can be seen as follows:

is_production = filter tfrun.workspace.tags as _, tag {
		tag is "source:azure"
} is not empty
is_production = filter tfrun.workspace.tags as _, tag {		tag is "source:azure"} is not empty

You can find a more complete policy example in the Sentinel Playground. The example has mock tfplan and tfrun data alongside a Sentinel policy that includes the above code block to check for a particular tag.

»Get Started

HashiCorp Terraform Cloud is continuously improving the way workspaces are organized and managed. Workspace tags are the newest addition and provide a great new way to include actionable metadata to each workspace within an organization.

Terraform Cloud is free to get started, and organizations can upgrade to the Team & Governance or Business tiers at any time. To get started, sign-up for Terraform Cloud and follow our Get Started tutorial or contact HashiCorp Sales.


Sign up for the latest HashiCorp news