@globallogicuki/backstage-plugin-terraform
v0.11.5
Published
You can use this plugin to display a list of terraform runs for one or more workspaces.
Downloads
1,755
Readme
Terraform Frontend Plugin for Backstage
You can use this plugin to display a list of terraform runs for one or more workspaces.


Install
yarn add @globallogicuki/backstage-plugin-terraformSetup
This plugin is designed to work in its own tab within an entity. You will need to add the <EntityTerraformContent /> component to the entity page in the frontend app.
There is a isTerraformAvailable helper function and a <EntityTerraformCard /> 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:
import { EntityTerraformContent } from '@globallogicuki/backstage-plugin-terraform';Then add the following route and component to the desired entity page:
<EntityLayout.Route path="/terraform" title="Terraform">
<EntityTerraformContent />
</EntityLayout.Route>There are two annotations that you should add to your catalog-info.yaml file:
annotations:
terraform/organization: orgName
terraform/workspaces: workspaceName1,workspaceName2,workspaceName3You will also need to have the terraform backend plugin installed and running.
Terraform Latest Run card


This is an additional component that can be referenced with <EntityTerraformLatestRunCard> and imported and added to the EntityPage.tsx file for routing.
Terraform Workspace Health card

This is an additional component that can be referenced with <EntityTerraformWorkspaceHealthAssessmentsCard> 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 <TerraformWorkspaceHealthAssessments> 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.
Terraform Drift Metrics

The Drift card is visible within the Workspace Health component by default, but can be optionally hidden using the showDrift property on the <TerraformWorkspaceHealthAssessments> tag, eg:
<TerraformWorkspaceHealthAssessments showDrift={false}>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.
Terraform Validation Checks

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 <TerraformWorkspaceHealthAssessments> tag, eg:
<TerraformWorkspaceHealthAssessments showValidationChecks={false}>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.
