Skip to content

Instantly share code, notes, and snippets.

View larkintuckerllc's full-sized avatar

John Tucker larkintuckerllc

View GitHub Profile
...
my-plugin:
accessKeyId: ${MY_PLUGIN_ACCESS_KEY_ID}
secretAccessKey: ${MY_PLUGIN_SECRET_ACCESS_KEY}
...
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: my-my-plugin-component
annotations:
my-plugin/bucket-name: my-bucket
spec:
lifecycle: production
owner: my-team
type: service
/*
* Hi!
*
* Note that this is an EXAMPLE Backstage backend. Please check the README.
*
* Happy hacking!
*/
import Router from 'express-promise-router';
import {
import { Config } from '@backstage/config'
import { createRouter } from '@internal/plugin-my-plugin-backend';
import { PluginEnvironment } from '../types';
export default async function createPlugin(config: Config, env: PluginEnvironment) {
// Here is where you will add all of the required initialization code that
// your backend plugin needs to be able to start!
// The env contains a lot of goodies, but our router currently only
// needs a logger
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import {
createApiFactory,
createPlugin,
createRoutableExtension,
discoveryApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { MyPluginBackendClient } from './api/MyPluginBackendClient';
import { myPluginApiRef } from './api/types';
import { rootCatalogMyPluginRouteRef } from './routes';
import { MyPluginApi } from './types';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
export class MyPluginBackendClient implements MyPluginApi {
private readonly discoveryApi: DiscoveryApi;
private readonly identityApi: IdentityApi;
constructor(options: {
discoveryApi: DiscoveryApi;
identityApi: IdentityApi;
}) {
import {
createApiFactory,
createPlugin,
createRoutableExtension,
discoveryApiRef,
} from '@backstage/core-plugin-api';
import { MyPluginBackendClient } from './api/MyPluginBackendClient';
import { myPluginApiRef } from './api/types';
import { rootCatalogMyPluginRouteRef } from './routes';