{"_id":"@ediri/backstage-plugin-pulumi-og","name":"@ediri/backstage-plugin-pulumi-og","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ediri/backstage-plugin-pulumi-og","version":"0.1.0","main":"src/index.ts","types":"src/index.ts","license":"Apache-2.0","publishConfig":{"access":"public","main":"dist/index.esm.js","types":"dist/index.d.ts"},"backstage":{"role":"frontend-plugin"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","lint":"backstage-cli package lint","test":"backstage-cli package test","clean":"backstage-cli package clean","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack"},"dependencies":{"@backstage/errors":"^1.2.1","@backstage/catalog-model":"^1.4.1","@backstage/core-components":"^0.13.4","@backstage/core-plugin-api":"^1.5.3","@backstage/plugin-catalog-react":"^1.8.3","@backstage/plugin-kubernetes":"^0.10.2","@backstage/plugin-kubernetes-common":"^0.6.5","@backstage/theme":"^0.4.1","@material-ui/core":"^4.12.2","@material-ui/icons":"^4.9.1","@material-ui/lab":"4.0.0-alpha.61","react-use":"^17.2.4"},"peerDependencies":{"react":"^16.13.1 || ^17.0.0"},"devDependencies":{"@backstage/cli":"^0.22.13","@backstage/core-app-api":"^1.9.0","@backstage/dev-utils":"^1.0.17","@backstage/test-utils":"^1.4.1","@testing-library/jest-dom":"^5.10.1","@testing-library/react":"^12.1.3","@testing-library/user-event":"^14.0.0","@types/node":"*","msw":"^1.0.0","typescript":"~5.0.0"},"resolutions":{"@types/react":"^17.0.39","@types/react-dom":"^17.0.21"},"gitHead":"d88a8f6cc800ac16a5c74ebbbf1833bbcd522356","description":"- Display relevant Pulumi information about an entity within Backstage, such as the Pulumi stack, organization, project   name, and project description. - Show the Pulumi activity view for an entity within Backstage.","_id":"@ediri/backstage-plugin-pulumi-og@0.1.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-pC+0IlIXlb/Ny4FBxIg7hpiJ1CwbSY0CHzyBv6nWRUfAZunppEGQhj7Xq82ib4MJMU2lPANyle2BCLqOxUbVLQ==","shasum":"c2397b0dba9ff9dbf81fef66fe6fe02b8dcb38b0","tarball":"https://registry.npmjs.org/@ediri/backstage-plugin-pulumi-og/-/backstage-plugin-pulumi-og-0.1.0.tgz","fileCount":5,"unpackedSize":85545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjQ86G3lSgiOb+2eh35AipB2r0mnrqjKfCAyRVm2ankAIgGac+u+FGQb9TRQrVHVPK54nXLLwagRuKuW3951SURP0="}]},"_npmUser":{"name":"ediri","email":"engin.diri@ediri.de"},"directories":{},"maintainers":[{"name":"ediri","email":"engin.diri@ediri.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backstage-plugin-pulumi-og_0.1.0_1695831642136_0.701400023122154"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-27T16:20:42.051Z","0.1.0":"2023-09-27T16:20:42.399Z","modified":"2023-09-27T16:20:42.664Z"},"maintainers":[{"name":"ediri","email":"engin.diri@ediri.de"}],"description":"- Display relevant Pulumi information about an entity within Backstage, such as the Pulumi stack, organization, project   name, and project description. - Show the Pulumi activity view for an entity within Backstage.","license":"Apache-2.0","readme":"## Pulumi Plugin\n\n- Display relevant Pulumi information about an entity within Backstage, such as the Pulumi stack, organization, project\n  name, and project description.\n- Show the Pulumi activity view for an entity within Backstage.\n\n### Requirements\n\n- Setup of the Pulumi plugin for Backstage requires a Pulumi Organization admin to generate a Pulumi access token for\n  the Backstage application.\n\n### Feature Overview\n\n#### Pulumi Card (Component Overview)\n\n<img src=\"../doc/component.png\" width=\"500\">\n\n#### Pulumi Card (System Overview)\n\n<img src=\"../doc/system.png\" width=\"500\">\n\n#### Pulumi Activity View\n\n<img src=\"../doc/activity.png\" width=\"500\">\n\n### Support\n\nIf you need any help with this plugin, feel free to reach out to me!\n\n### Integration Walk-through\n\n#### Install the plugin\n\nThe file paths mentioned in the following steps are relative to your app's root directory — for example, the directory\ncreated by following the [Getting Started](https://backstage.io/docs/getting-started/) guide and creating your app with\n`npx @backstage/create-app`.\n\nFirst, install the Pulumi plugin via a CLI:\n\n```bash\n# From your Backstage root directory\nyarn add --cwd packages/app @pulumi/backstage-plugin-pulumi\n```\n\nNext, add the plugin to `EntityPage.tsx` in `packages/app/src/components/catalog` by adding the following code snippets.\n\nAdd the following imports to the top of the file:\n\n```tsx\nimport {\n    isPulumiAvailable,\n    EntityPulumiCard,\n    EntityPulumiMetdataCard,\n    PulumiComponent\n} from '@pulumi/backstage-plugin-pulumi';\n```\n\nThen create a new constant for the Pulumi Component:\n\n```tsx\nconst pulumiContent = (\n    <EntitySwitch>\n        <EntitySwitch.Case if={isPulumiAvailable}>\n            <PulumiComponent/>\n        </EntitySwitch.Case>\n    </EntitySwitch>\n);\n```\n\nFind const `overviewContent` in `EntityPage.tsx`, and add the following snippet inside the outermost Grid defined there,\njust before the closing `</Grid>` tag:\n\n```tsx\n<EntitySwitch>\n    <EntitySwitch.Case if={isPulumiAvailable}>\n        <Grid item md={6}>\n            <EntityPulumiCard variant=\"gridItem\"/>\n        </Grid>\n    </EntitySwitch.Case>\n</EntitySwitch>\n```\n\nNow find the `serviceEntityPage` constant in `EntityPage.tsx`, and add the following snippet inside:\n\n```tsx\n<EntityLayout.Route path=\"/pulumi\" title=\"Pulumi\" if={isPulumiAvailable}>\n    {pulumiContent}\n</EntityLayout.Route>\n```\n\nLastly, find the `systemPage` constant in `EntityPage.tsx`, and add the following snippet inside after the\nclosing `</Grid>` tag of the `<EntityAboutCard variant=\"gridItem\" />`:\n\n```tsx\n  <EntitySwitch>\n    <EntitySwitch.Case if={isPulumiAvailable}>\n        <Grid item md={6}>\n            <EntityPulumiMetdataCard/>\n        </Grid>\n    </EntitySwitch.Case>\n</EntitySwitch>\n```\n\n#### Configure the plugin\n\nFirst, annotate your component/resource entity with the following:\n\n```yaml\nannotations:\n  pulumi.com/project-slug: [ Pulumi Cloud Name: org/stackname/stack ]\n```\n\nAnd your system entity with the following:\n\n```yaml\nannotations:\n  pulumi.com/orga-slug: <Pulumi Cloud: org>\n```\n\nNext, provide the API token that the client will use to make requests to the Pulumi Cloud API.\n\nAdd the proxy configuration in `app-config.yaml`:\n\n```yaml\nproxy:\n  '/pulumi':\n    target: 'https://api.pulumi.com/api'\n    changeOrigin: true\n    headers:\n      Authorization: token ${PULUMI_ACCESS_TOKEN}\n      Accept: application/vnd.pulumi+8\n      Content-Type: application/json\n```\n\nThen, start the backend, passing the PagerDuty API token as an environment variable:\n\n```bash\nexport PULUMI_ACCESS_TOKEN='<PULUMI_ACCESS_TOKEN>' \nyarn start\n```\n\nThis will proxy the request by adding an `Authorization` header with the provided token.\n\n#### How to Uninstall\n\n1. Remove any configuration added in Backstage yaml files, such as the proxy configuration in `app-config.yaml` and the integration key in an entity's annotations.\n1. Remove the added code snippets from `EntityPage.tsx`\n1. Remove the plugin package:\n\n```bash\n# From your Backstage root directory\nyarn remove --cwd packages/app @pulumi/backstage-plugin-pulumi\n```\n","readmeFilename":"README.md"}