You can use this plugin to display a list of terraform runs for one or more workspaces.
npm install @globallogicuki/backstage-plugin-terraformYou can use this plugin to display a list of terraform runs for one or more workspaces.
!Terraform Runs - Single Workspace
!Terraform Runs - Multiple Workspaces
``shell`
yarn add @globallogicuki/backstage-plugin-terraform
This plugin is designed to work in its own tab within an entity. You will need to add the component to the entity page in the frontend app.
There is a isTerraformAvailable helper function and a component available should you wish to use this within an existing tab.
Edit the packages/app/src/components/catalog/EntityPage.tsx and add the imports:
`typescript`
import { EntityTerraformContent } from '@globallogicuki/backstage-plugin-terraform';
Then add the following route and component to the desired entity page:
`typescript`
There are two annotations that you should add to your catalog-info.yaml file:
`yaml`
annotations:
terraform/organization: orgName
terraform/workspaces: workspaceName1,workspaceName2,workspaceName3
You will also need to have the terraform backend plugin installed and running.
!Latest Run card - Single Workspace
!Latest Run card - Multiple Workspaces
This is an additional component that can be referenced with and imported and added to the EntityPage.tsx file for routing.
!Workspace Health card - Light mode
This is an additional component that can be referenced with and imported and added to the EntityPage.tsx file for routing from the plugin root.
Alternatively it can be referenced from within another component, using the tag.
It will render a Health Card for each workspace defined in your catalog-info.yaml file, with each Health Card containing child cards for Drift Metrics and Validation Checks for a particular workspace.
!Workspace Health card - Drift Only
The Drift card is visible within the Workspace Health component by default, but can be optionally hidden using the showDrift property on the tag, eg:
The Drift card further incorporates a navigational element, providing a direct link to the dedicated Drift view for the Workspace within your Terraform deployment if a more granular breakdown is required.
!Workspace Health card - Validation Checks Only
The Validation Checks card is also visible within the Workspace Health component by default, but can be optionally hidden using the showValidationChecks property on the
The Validation Checks card also incorporates a direct link to the Continuous Validation view for the Workspace within your Terraform deployment if a more detailed breakdown is needed.