Skip to main content

Show the Terraform tab on a component

Each annotated component gets a Terraform tab: the Terraform Cloud workspaces it names, and their last runs.

Two steps: turn on the plugin, annotate the component.

What the tab shows, and to whom​

The Terraform Cloud workspaces named by the component, each with its last runs. Anyone who can open the component sees the tab. Astrolabe reads Terraform Cloud with the token of the integration, the same for everyone.

1. πŸ”Œ Turn on the plugin​

  1. In Administration, under PLATFORM, click Plugins.

  2. On the Terraform card, turn on the switch at the top right.

If the card says Configure the Terraform integration first, click it: the integration opens in Company connections. Add it (Add the Terraform integration). The plugin turns on by itself when you save the integration: go to step 2.

The card has no settings: Terraform Cloud is entered once, in the integration.

2. 🏷️ Annotate the component​

In the catalog-info.yaml file of the component, add both annotations:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: shop-api
annotations:
terraform/organization: acme
terraform/workspaces: shop-api,shop-api-staging
spec:
type: service
lifecycle: production
owner: team-a
AnnotationWhat to writeExample
terraform/organizationThe name of your Terraform Cloud organizationacme
terraform/workspacesThe names of the workspaces, separated by commasshop-api,shop-api-staging

βœ… Check​

Open the component in Catalog. A Terraform tab is in the tab bar, next to Overview. Click it: each workspace is listed with its last runs.

The list of runs was not checked on a live instance.

βœ… That's it!

Something is wrong? See Common problems with Terraform Cloud.