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β
-
In Administration, under PLATFORM, click Plugins.
-
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
| Annotation | What to write | Example |
|---|---|---|
terraform/organization | The name of your Terraform Cloud organization | acme |
terraform/workspaces | The names of the workspaces, separated by commas | shop-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.