Skip to content

Code conformance for aws-apps plugin #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backstage-plugins/plugins/aws-apps/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
20 changes: 20 additions & 0 deletions backstage-plugins/plugins/aws-apps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @aws/plugin-aws-apps-for-backstage

## 0.4.0

### Minor Changes

- b76307e: Implemented `@backstage/integration-aws-node` enabling reuse of credentials shared with other AWS integrated plugins (e.g. [Roadie](https://github.com/RoadieHQ/roadie-backstage-plugins/tree/main/plugins/backend/catalog-backend-module-aws), [AWS CodeStar](https://github.com/awslabs/backstage-plugins-for-aws)), and running Harmonix outside of an AWS account (Credits: @fjudith). Bump framework version 1.30.4, optimized code-style, and comply CI with [community-plugins](https://github.com/backstage/community-plugins) (Credits: @fleveillee).

### Patch Changes

- Updated dependencies [b76307e]
- @aws/[email protected]

## 0.3.6

### Patch Changes

- 95c1ddb: Bump framework version 1.30.4 and aligned with `backstage/community-plugins` best practices
- Updated dependencies [95c1ddb]
- @aws/[email protected]
15 changes: 9 additions & 6 deletions backstage-plugins/plugins/aws-apps/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!--
<!--
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
-->

# OPA on AWS Frontend

This is the frontend UI of the OPA on AWS plugin. An AWS Catalog Page and several entity cards are contributed to the UI from this plugin.
This is the frontend UI of the OPA on AWS plugin. An AWS Catalog Page and several entity cards are contributed to the UI from this plugin.

- [Installation](#installation)
- [Configuration](#configuration)
Expand All @@ -23,13 +24,14 @@ yarn add --cwd packages/app @aws/[email protected]

## Configuration

Each of the UI components contributed in the OPA on AWS frontend plugin can be configured independently and added to your Backstage platform as desired. Details for adding each type of UI component are found in the sections below.
Each of the UI components contributed in the OPA on AWS frontend plugin can be configured independently and added to your Backstage platform as desired. Details for adding each type of UI component are found in the sections below.

### EntityPage customization for AWS apps

To build an AWS app-specific entity presentation, we will rely on identification of a component as being of type "aws-app" (as specified under the `spec.type` configuration in the entity's `catalog-info.yaml` file).

Add the code shown below to `EntityPage.tsx`

```ts
// packages/app/src/components/catalog/EntityPage.tsx

Expand Down Expand Up @@ -117,9 +119,10 @@ const resourceEntityPage = (
);

```

When running the Backstage app, you are now setup for customized views of AWS applications in the platform.

### AWS Software Catalog Page
### AWS Software Catalog Page

The AWS Software Catalog page provides a customized view into the Backstage catalog with a focus on applications deployed to AWS through Backstage.
![AWS Software Catalog Page](images/ui_aws_software_catalog.png 'AWS Software Catalog Page')
Expand Down Expand Up @@ -159,7 +162,7 @@ const routes = (
```

Next, add the AWS Software Catalog to the sidebar navigation in the `Root.tsx` file.
Determine your preferred placement in the sidebar using the example below as guidance. Exact contents and children of the <SidebarPage> may differ in your installation.
Determine your preferred placement in the sidebar using the example below as guidance. Exact contents and children of the <SidebarPage> may differ in your installation.

```diff
// packages/app/src/components/Root/Root.tsx
Expand Down
115 changes: 115 additions & 0 deletions backstage-plugins/plugins/aws-apps/api-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
## API Report File for "@aws/plugin-aws-apps-for-backstage"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="react" />

import { BackstagePlugin } from '@backstage/core-plugin-api';
import { DefaultCatalogPageProps } from '@backstage/plugin-catalog';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';

// Warning: (ae-forgotten-export) The symbol "AppCatalogPage_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const AppCatalogPage: AppCatalogPage_2;

// Warning: (ae-forgotten-export) The symbol "AwsAppPage_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const AwsAppPage: AwsAppPage_2;

// Warning: (ae-forgotten-export) The symbol "AwsComponentPage_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const AwsComponentPage: AwsComponentPage_2;

// Warning: (ae-forgotten-export) The symbol "AwsEnvironmentPage_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const AwsEnvironmentPage: AwsEnvironmentPage_2;

// Warning: (ae-forgotten-export) The symbol "AwsEnvironmentProviderPage_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const AwsEnvironmentProviderPage: AwsEnvironmentProviderPage_2;

// @public (undocumented)
export const EntityAnnotationTypeTable: ({
type,
}: {
type: string;
}) => JSX_2.Element;

// @public (undocumented)
export const EntityAppConfigCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityAppPromoCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityAppStateCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityAppStateCardCloudFormation: () => JSX_2.Element;

// @public (undocumented)
export const EntityAuditTable: () => JSX_2.Element;

// @public (undocumented)
export const EntityAwsEnvironmentProviderSelectorCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityCloudwatchLogsTable: () => JSX_2.Element;

// @public (undocumented)
export const EntityDeleteAppCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityDeleteEnvironmentCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityDeleteProviderCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityEnvironmentInfoCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityEnvironmentSelector: () => JSX_2.Element;

// @public (undocumented)
export const EntityGeneralInfoCard: ({
appPending,
}: {
appPending: boolean;
}) => JSX_2.Element;

// @public (undocumented)
export const EntityInfrastructureInfoCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityK8sAppStateCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityLabelTable: () => JSX_2.Element;

// @public (undocumented)
export const EntityProviderInfoCard: () => JSX_2.Element;

// @public (undocumented)
export const EntityResourceBindingCard: () => JSX_2.Element;

// @public (undocumented)
export const opaPlugin: BackstagePlugin<
{
root: RouteRef<undefined>;
},
{},
{}
>;

// (No @packageDocumentation comment for this package)
```
38 changes: 26 additions & 12 deletions backstage-plugins/plugins/aws-apps/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@aws/plugin-aws-apps-for-backstage",
"description": "App Development for Backstage.io on AWS Frontend plugin",
"version": "0.3.5",
"version": "0.4.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"author": {
"name": "Amazon Web Services",
"url": "http://aws.amazon.com"
"url": "https://aws.amazon.com"
},
"publishConfig": {
"access": "public",
Expand All @@ -25,8 +25,11 @@
"backstage": {
"role": "frontend-plugin",
"pluginId": "aws-apps",
"pluginPackages": ["@backstage/plugin-catalog"]
"pluginPackages": [
"@aws/plugin-aws-apps-for-backstage"
]
},
"sideEffects": false,
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
Expand All @@ -37,52 +40,63 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@aws/plugin-aws-apps-common-for-backstage": "workspace:^",
"@aws-sdk/client-cloudformation": "^3.623.0",
"@aws-sdk/client-cloudwatch-logs": "^3.623.0",
"@aws-sdk/client-dynamodb": "^3.623.0",
"@aws-sdk/client-ecs": "^3.623.0",
"@aws-sdk/client-eks": "^3.623.0",
"@aws-sdk/client-s3": "^3.623.0",
"@aws-sdk/client-lambda": "^3.623.0",
"@aws-sdk/client-s3": "^3.623.0",
"@aws-sdk/client-secrets-manager": "^3.623.0",
"@aws-sdk/client-ssm": "^3.623.0",
"@aws-sdk/util-arn-parser": "^3.568.0",
"@aws/plugin-aws-apps-common-for-backstage": "^0.3.4",
"@aws/backstage-plugin-catalog-backend-module-aws-apps-entities-processor": "^0.3.4",
"@immobiliarelabs/backstage-plugin-gitlab": "^6.6.0",
"@backstage-community/plugin-github-actions": "^0.6.16",
"@backstage/catalog-model": "^1.5.0",
"@backstage/core-components": "^0.14.9",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/errors": "^1.2.4",
"@backstage/plugin-catalog": "^1.21.1",
"@backstage/plugin-catalog-graph": "^0.4.7",
"@backstage/plugin-catalog-react": "^1.12.2",
"@backstage/plugin-permission-react": "^0.4.24",
"@backstage/plugin-techdocs": "^1.10.7",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.12",
"@backstage/plugin-techdocs-react": "^1.2.6",
"@backstage/theme": "^0.5.6",
"@backstage/types": "^1.1.1",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@immobiliarelabs/backstage-plugin-gitlab": "^6.6.0",
"@kubernetes/client-node": "^0.21.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^5.0.0-alpha.4",
"@material-ui/lab": "^4.0.0-alpha.61",
"@mui/base": "^5.0.0-beta.40",
"@mui/icons-material": "^5.16.6",
"@mui/material": "^5.16.6",
"@mui/system": "^5.16.6",
"file-saver": "^2.0.5",
"react-use": "^17.5.1"
},
"peerDependencies": {
"react": "^18.0.2"
"react": "^18.0.2",
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-router": "6.0.0-beta.0 || ^6.3.0",
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
},
"devDependencies": {
"@backstage/cli": "^0.26.11",
"@backstage/core-app-api": "^1.14.1",
"@backstage/dev-utils": "^1.0.36",
"@backstage/test-utils": "^1.5.9",
"@backstage/core-app-api": "^1.14.0",
"@backstage/dev-utils": "^1.0.35",
"@backstage/test-utils": "^1.5.8",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/file-saver": "^2.0.5",
"@types/node": "*",
"@types/react": "*",
"cross-fetch": "^4.0.0",
"msw": "^2.3.5"
},
Expand Down
38 changes: 24 additions & 14 deletions backstage-plugins/plugins/aws-apps/src/api/OPAApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,40 @@ import {
DeleteStackCommandOutput,
DescribeStackEventsCommandOutput,
Stack,
UpdateStackCommandOutput
} from "@aws-sdk/client-cloudformation";
UpdateStackCommandOutput,
} from '@aws-sdk/client-cloudformation';
import { LogStream } from '@aws-sdk/client-cloudwatch-logs';
import { ScanCommandOutput } from '@aws-sdk/client-dynamodb';
import { Service, Task, TaskDefinition } from '@aws-sdk/client-ecs';
import { HeadObjectCommandOutput } from '@aws-sdk/client-s3';
import { DeleteSecretCommandOutput, GetSecretValueCommandOutput } from '@aws-sdk/client-secrets-manager';
import {
DeleteSecretCommandOutput,
GetSecretValueCommandOutput,
} from '@aws-sdk/client-secrets-manager';
import { GetParameterCommandOutput } from '@aws-sdk/client-ssm';
import { AWSProviderParams, AWSServiceResources, BackendParams, BindResourceParams, AWSEnvironmentProviderRecord } from '@aws/plugin-aws-apps-common-for-backstage';
import {
AWSProviderParams,
AWSServiceResources,
BackendParams,
BindResourceParams,
AWSEnvironmentProviderRecord,
} from '@aws/plugin-aws-apps-common-for-backstage';
import { createApiRef } from '@backstage/core-plugin-api';
import { ContainerDetailsType } from '../types';
import { InvokeCommandOutput } from "@aws-sdk/client-lambda";
import { IRepositoryInfo } from "@aws/plugin-aws-apps-common-for-backstage";
import { InvokeCommandOutput } from '@aws-sdk/client-lambda';
import { IRepositoryInfo } from '@aws/plugin-aws-apps-common-for-backstage';

export const opaApiRef = createApiRef<OPAApi>({
id: 'plugin.opa.app',
});

export interface OPAApi {

setPlatformParams(appName: string, region: string): void;
setBackendParams(backendParams: BackendParams): void;

getAuditDetails(backendParamsOverrides?: BackendParams): Promise<ScanCommandOutput>;
getAuditDetails(
backendParamsOverrides?: BackendParams,
): Promise<ScanCommandOutput>;

getTaskDetails({
service,
Expand All @@ -38,7 +48,7 @@ export interface OPAApi {
}: {
service: string;
cluster: string;
backendParamsOverrides?: BackendParams
backendParamsOverrides?: BackendParams;
}): Promise<Task>;

updateService({
Expand Down Expand Up @@ -130,7 +140,7 @@ export interface OPAApi {
}): Promise<any>;

deletePlatformSecret({
secretName
secretName,
}: {
secretName: string;
}): Promise<DeleteSecretCommandOutput>;
Expand Down Expand Up @@ -291,7 +301,7 @@ export interface OPAApi {
functionName,
actionDescription,
body,
backendParamsOverrides
backendParamsOverrides,
}: {
functionName: string;
actionDescription: string;
Expand All @@ -303,13 +313,13 @@ export interface OPAApi {
envName,
gitAdminSecret,
repoInfo,
backendParamsOverrides
backendParamsOverrides,
}: {
envName: string;
gitAdminSecret: string;
repoInfo: IRepositoryInfo;
backendParamsOverrides?: BackendParams;
}): Promise<any>
}): Promise<any>;

updateEKSApp({
actionDescription,
Expand All @@ -321,7 +331,7 @@ export interface OPAApi {
lambdaRoleArn,
gitAdminSecret,
repoInfo,
backendParamsOverrides
backendParamsOverrides,
}: {
actionDescription: string;
envName: string;
Expand Down
Loading