# Harness IACM plugin
npm install @harnessio/backstage-plugin-harness-iacmWebsite: https://harness.io/
Welcome to the Harness IACM plugin for Backstage!

1. Open terminal and navigate to the _root of your Backstage app_. Then run
``
yarn add --cwd packages/app @harnessio/backstage-plugin-iacm
yarn install
`
If you are looking to get started with Backstage, check out backstage.io/docs.
For testing purposes, you can also clone this repository to try out the plugin. It contains an example Backstage app setup which is pre-installed with Harness plugins. However, you must create a new Backstage app if you are looking to get started with Backstage.
2. Configure proxy for harness in your app-config.yaml under the proxy config. Add your Harness Personal Access Token or Service Account Token for x-api-key. See the Harness docs for generating an API Key.
`yamlIn app-config.yaml
proxy:
# ... existing proxy settings
'/harness/prod':
target: 'https://app.harness.io/'
headers:
'x-api-key': '...
`
Notes:
- Plugin uses token configured here to make Harness API calls. Make sure the user creating this API token has necessary permissions, which include project view permission along with pipeline view and execute permissions and same applies for service accounts as well it must have a role assigned that has the roles with adequate permissions as described before.
- Set the value of target to your on-prem URL if you are using the Harness on-prem offering
3. Inside your Backstage's EntityPage.tsx, import the EntityIacmContent and isHarnessIacmAvailable from @harnessio/backstage-plugin-iacm and add . Something like this -
`tsx
// In packages/app/src/components/catalog/EntityPage.tsx
import {
isHarnessIacmAvailable,
EntityIacmContent,
} from '@harnessio/backstage-plugin-iacm';
const iacmContent = (
// ...
// ...
);
`
Instructions in case of multiple IACM based plugins (Click to expand)
`tsx
// In packages/app/src/components/catalog/EntityPage.tsx
import {
isHarnessIacmAvailable,
EntityIacmContent,
} from '@harnessio/backstage-plugin-iacm';
const serviceEntityPage = (
// ...
title="Harness IACM"
if={isHarnessIacmAvailable}
>
// ...
);
`
4. Add required harness specific annotations to your software component's respective catalog-info.yaml file.
Here is an example: catalog-info-new.yaml
`yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
# ...
annotations:
# annotation
harness.io/workspace-url: |
labelA:
labelB:
# here labelA / labelB denotes the value you will see in dropdown in workspace list.
``
- Connect a Backstage service with a Harness workspace and view workspace resources.
- Navigate directly to specific pipeline from backstage