@backstage/plugin-catalog-backend-module-aws 0.3.16 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -12
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,37 +1,55 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-aws
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.17
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 4afa050: Export `defaultEksClusterEntityTransformer` to allow library consumers to layer additional changes on top of the default transformer.
|
|
7
8
|
- Updated dependencies
|
|
8
|
-
- @backstage/backend-plugin-api@0.
|
|
9
|
-
- @backstage/backend-
|
|
10
|
-
- @backstage/backend-
|
|
11
|
-
- @backstage/
|
|
9
|
+
- @backstage/backend-plugin-api@0.7.0
|
|
10
|
+
- @backstage/backend-common@0.23.3
|
|
11
|
+
- @backstage/backend-tasks@0.5.27
|
|
12
|
+
- @backstage/integration@1.13.0
|
|
13
|
+
- @backstage/plugin-catalog-node@1.12.4
|
|
14
|
+
- @backstage/plugin-catalog-common@1.0.25
|
|
15
|
+
- @backstage/plugin-kubernetes-common@0.8.1
|
|
12
16
|
- @backstage/catalog-model@1.5.0
|
|
13
17
|
- @backstage/config@1.2.0
|
|
14
18
|
- @backstage/errors@1.2.4
|
|
15
|
-
- @backstage/integration@1.12
|
|
19
|
+
- @backstage/integration-aws-node@0.1.12
|
|
20
|
+
|
|
21
|
+
## 0.3.17-next.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @backstage/backend-common@0.23.3-next.1
|
|
27
|
+
- @backstage/backend-plugin-api@0.6.22-next.1
|
|
28
|
+
- @backstage/backend-tasks@0.5.27-next.1
|
|
29
|
+
- @backstage/catalog-model@1.5.0
|
|
30
|
+
- @backstage/config@1.2.0
|
|
31
|
+
- @backstage/errors@1.2.4
|
|
32
|
+
- @backstage/integration@1.13.0-next.0
|
|
16
33
|
- @backstage/integration-aws-node@0.1.12
|
|
17
34
|
- @backstage/plugin-catalog-common@1.0.24
|
|
35
|
+
- @backstage/plugin-catalog-node@1.12.4-next.1
|
|
18
36
|
- @backstage/plugin-kubernetes-common@0.8.0
|
|
19
37
|
|
|
20
|
-
## 0.3.
|
|
38
|
+
## 0.3.16-next.0
|
|
21
39
|
|
|
22
40
|
### Patch Changes
|
|
23
41
|
|
|
24
42
|
- Updated dependencies
|
|
25
|
-
- @backstage/backend-
|
|
26
|
-
- @backstage/backend-
|
|
27
|
-
- @backstage/backend-
|
|
43
|
+
- @backstage/backend-plugin-api@0.6.21-next.0
|
|
44
|
+
- @backstage/backend-common@0.23.2-next.0
|
|
45
|
+
- @backstage/backend-tasks@0.5.26-next.0
|
|
46
|
+
- @backstage/integration@1.13.0-next.0
|
|
47
|
+
- @backstage/plugin-catalog-node@1.12.3-next.0
|
|
28
48
|
- @backstage/catalog-model@1.5.0
|
|
29
49
|
- @backstage/config@1.2.0
|
|
30
50
|
- @backstage/errors@1.2.4
|
|
31
|
-
- @backstage/integration@1.12.0
|
|
32
51
|
- @backstage/integration-aws-node@0.1.12
|
|
33
52
|
- @backstage/plugin-catalog-common@1.0.24
|
|
34
|
-
- @backstage/plugin-catalog-node@1.12.2
|
|
35
53
|
- @backstage/plugin-kubernetes-common@0.8.0
|
|
36
54
|
|
|
37
55
|
## 0.3.14
|
package/alpha/package.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -285,4 +285,5 @@ exports.ANNOTATION_AWS_ARN = ANNOTATION_AWS_ARN;
|
|
|
285
285
|
exports.AwsEKSClusterProcessor = AwsEKSClusterProcessor;
|
|
286
286
|
exports.AwsOrganizationCloudAccountProcessor = AwsOrganizationCloudAccountProcessor;
|
|
287
287
|
exports.AwsS3DiscoveryProcessor = AwsS3DiscoveryProcessor;
|
|
288
|
+
exports.defaultEksClusterEntityTransformer = defaultEksClusterEntityTransformer;
|
|
288
289
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/constants.ts","../src/lib/defaultTransformers.ts","../src/processors/AwsEKSClusterProcessor.ts","../src/awsOrganization/config.ts","../src/processors/AwsOrganizationCloudAccountProcessor.ts","../src/processors/AwsS3DiscoveryProcessor.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying AWS account id\n *\n * @public\n */\nexport const ANNOTATION_AWS_ACCOUNT_ID: string = 'amazonaws.com/account-id';\n/**\n * Annotation for specifying AWS arn\n *\n * @public\n */\nexport const ANNOTATION_AWS_ARN: string = 'amazonaws.com/arn';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { type Cluster } from '@aws-sdk/client-eks';\nimport {\n ANNOTATION_KUBERNETES_API_SERVER,\n ANNOTATION_KUBERNETES_API_SERVER_CA,\n ANNOTATION_KUBERNETES_AUTH_PROVIDER,\n ANNOTATION_KUBERNETES_AWS_CLUSTER_ID,\n} from '@backstage/plugin-kubernetes-common';\nimport type { EksClusterEntityTransformer } from '../processors/types';\nimport { ANNOTATION_AWS_ACCOUNT_ID, ANNOTATION_AWS_ARN } from '../constants';\n\n/**\n * Default transformer for EKS Cluster to Resource Entity\n * @public\n */\nexport const defaultEksClusterEntityTransformer: EksClusterEntityTransformer =\n async (cluster: Cluster, accountId: string) => {\n const { arn, endpoint, certificateAuthority, name } = cluster;\n const normalizedName = normalizeName(name as string);\n return {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Resource',\n metadata: {\n annotations: {\n [ANNOTATION_AWS_ACCOUNT_ID]: accountId,\n [ANNOTATION_AWS_ARN]: arn || '',\n [ANNOTATION_KUBERNETES_API_SERVER]: endpoint || '',\n [ANNOTATION_KUBERNETES_API_SERVER_CA]:\n certificateAuthority?.data || '',\n [ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'aws',\n [ANNOTATION_KUBERNETES_AWS_CLUSTER_ID]: normalizedName,\n },\n name: normalizedName,\n namespace: 'default',\n },\n spec: {\n type: 'kubernetes-cluster',\n owner: 'unknown',\n },\n };\n };\n\nfunction normalizeName(name: string): string {\n return name\n .trim()\n .toLocaleLowerCase('en-US')\n .replace(/[^a-zA-Z0-9\\-]/g, '-');\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { EKS } from '@aws-sdk/client-eks';\nimport { AWSCredentialFactory } from '../types';\nimport { AwsCredentialIdentity, Provider } from '@aws-sdk/types';\nimport {\n AwsCredentialsManager,\n DefaultAwsCredentialsManager,\n} from '@backstage/integration-aws-node';\nimport { Config } from '@backstage/config';\n\nimport type { EksClusterEntityTransformer } from './types';\nimport { defaultEksClusterEntityTransformer } from '../lib';\n\n/**\n * A processor for automatic discovery of resources from EKS clusters. Handles the\n * `aws-eks` location type, and target accounts/regions of the form\n * `<accountId>/<region>`.\n *\n * @public\n */\nexport class AwsEKSClusterProcessor implements CatalogProcessor {\n private credentialsFactory?: AWSCredentialFactory;\n private credentialsManager?: AwsCredentialsManager;\n private readonly clusterEntityTransformer: EksClusterEntityTransformer;\n\n static fromConfig(\n configRoot: Config,\n options?: {\n clusterEntityTransformer?: EksClusterEntityTransformer;\n },\n ): AwsEKSClusterProcessor {\n const awsCredentaislManager =\n DefaultAwsCredentialsManager.fromConfig(configRoot);\n return new AwsEKSClusterProcessor({\n credentialsManager: awsCredentaislManager,\n ...options,\n });\n }\n\n constructor(options: {\n credentialsFactory?: AWSCredentialFactory;\n credentialsManager?: AwsCredentialsManager;\n clusterEntityTransformer?: EksClusterEntityTransformer;\n }) {\n this.credentialsFactory = options.credentialsFactory;\n this.credentialsManager = options.credentialsManager;\n\n // If the callback function is not passed in, then default to the one upstream is using\n this.clusterEntityTransformer =\n options.clusterEntityTransformer || defaultEksClusterEntityTransformer;\n }\n\n getProcessorName(): string {\n return 'aws-eks';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== 'aws-eks') {\n return false;\n }\n\n // location target is of format \"account-id/region\"\n const [accountId, region] = location.target.split('/');\n\n if (!accountId || !region) {\n throw new Error(\n 'AWS EKS location specified without account or region information',\n );\n }\n\n let credentials: AwsCredentialIdentity | undefined;\n\n if (this.credentialsFactory) {\n credentials = await this.credentialsFactory(accountId);\n }\n\n let providerFunction: (() => Provider<AwsCredentialIdentity>) | undefined;\n if (this.credentialsManager) {\n const credentialsProvider =\n await this.credentialsManager.getCredentialProvider({ accountId });\n providerFunction = () => credentialsProvider.sdkCredentialProvider;\n }\n\n const eksClient = new EKS({\n credentials,\n credentialDefaultProvider: providerFunction,\n region,\n });\n const clusters = await eksClient.listClusters({});\n if (clusters.clusters === undefined) {\n return true;\n }\n\n const results = clusters.clusters\n .map(cluster => eksClient.describeCluster({ name: cluster }))\n .map(async describedClusterPromise => {\n const describedCluster = await describedClusterPromise;\n if (describedCluster.cluster) {\n const entity = await this.clusterEntityTransformer(\n describedCluster.cluster,\n accountId,\n );\n\n emit({\n type: 'entity',\n entity,\n location,\n });\n }\n });\n await Promise.all(results);\n return true;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\n\n/**\n * The configuration parameters for a single AWS Organization Processor\n */\nexport type AwsOrganizationProviderConfig = {\n /**\n * The role to assume for the processor.\n */\n roleArn?: string;\n};\n\nexport function readAwsOrganizationConfig(\n config: Config,\n): AwsOrganizationProviderConfig {\n const providerConfig = config.getOptionalConfig('provider');\n\n const roleArn = providerConfig?.getOptionalString('roleArn');\n return {\n roleArn,\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceEntityV1alpha1 } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n Account,\n ListAccountsResponse,\n Organizations,\n} from '@aws-sdk/client-organizations';\nimport { readAwsOrganizationConfig } from '../awsOrganization/config';\nimport {\n AwsCredentialProvider,\n DefaultAwsCredentialsManager,\n} from '@backstage/integration-aws-node';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nconst AWS_ORGANIZATION_REGION = 'us-east-1';\nconst LOCATION_TYPE = 'aws-cloud-accounts';\n\nconst ACCOUNTID_ANNOTATION = 'amazonaws.com/account-id';\nconst ACCOUNT_EMAIL_ANNOTATION = 'amazonaws.com/account-email';\nconst ARN_ANNOTATION = 'amazonaws.com/arn';\nconst ORGANIZATION_ANNOTATION = 'amazonaws.com/organization-id';\n\nconst ACCOUNT_STATUS_LABEL = 'amazonaws.com/account-status';\n\n/**\n * A processor for ingesting AWS Accounts from AWS Organizations.\n *\n * If custom authentication is needed, it can be achieved by configuring the\n * global AWS.credentials object.\n *\n * @public\n */\nexport class AwsOrganizationCloudAccountProcessor implements CatalogProcessor {\n private readonly organizations: Organizations;\n private readonly logger: LoggerService;\n\n static async fromConfig(config: Config, options: { logger: LoggerService }) {\n const c = config.getOptionalConfig('catalog.processors.awsOrganization');\n const orgConfig = c ? readAwsOrganizationConfig(c) : undefined;\n const awsCredentialsManager =\n DefaultAwsCredentialsManager.fromConfig(config);\n const credProvider = await awsCredentialsManager.getCredentialProvider({\n arn: orgConfig?.roleArn,\n });\n return new AwsOrganizationCloudAccountProcessor(\n credProvider,\n options.logger,\n );\n }\n\n private constructor(\n private readonly credProvider: AwsCredentialProvider,\n logger: LoggerService,\n ) {\n this.logger = logger?.child({\n target: this.getProcessorName(),\n });\n this.organizations = new Organizations({\n credentialDefaultProvider: () => this.credProvider.sdkCredentialProvider,\n region: AWS_ORGANIZATION_REGION,\n }); // Only available in us-east-1\n }\n\n getProcessorName(): string {\n return 'AwsOrganizationCloudAccountProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== LOCATION_TYPE) {\n return false;\n }\n\n this.logger?.info('Discovering AWS Organization Account objects');\n\n (await this.getAwsAccounts())\n .map(account => this.mapAccountToComponent(account))\n .filter(entity => {\n if (location.target !== '') {\n if (entity.metadata.annotations) {\n return (\n entity.metadata.annotations[ORGANIZATION_ANNOTATION] ===\n location.target\n );\n }\n return false;\n }\n return true;\n })\n .forEach(entity => {\n emit(processingResult.entity(location, entity));\n });\n\n return true;\n }\n\n private normalizeName(name: string): string {\n return name\n .trim()\n .toLocaleLowerCase('en-US')\n .replace(/[^a-zA-Z0-9\\-]/g, '-');\n }\n\n private normalizeAccountStatus(name: string): string {\n return name.toLocaleLowerCase('en-US');\n }\n\n private extractInformationFromArn(arn: string): {\n accountId: string;\n organizationId: string;\n } {\n const parts = arn.split('/');\n\n return {\n accountId: parts[parts.length - 1],\n organizationId: parts[parts.length - 2],\n };\n }\n\n private async getAwsAccounts(): Promise<Account[]> {\n let awsAccounts: Account[] = [];\n let isInitialAttempt = true;\n let nextToken = undefined;\n while (isInitialAttempt || nextToken) {\n isInitialAttempt = false;\n const orgAccounts: ListAccountsResponse =\n await this.organizations.listAccounts({ NextToken: nextToken });\n if (orgAccounts.Accounts) {\n awsAccounts = awsAccounts.concat(orgAccounts.Accounts);\n }\n nextToken = orgAccounts.NextToken;\n }\n\n return awsAccounts;\n }\n\n private mapAccountToComponent(account: Account): ResourceEntityV1alpha1 {\n const { accountId, organizationId } = this.extractInformationFromArn(\n account.Arn as string,\n );\n return {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Resource',\n metadata: {\n annotations: {\n [ACCOUNTID_ANNOTATION]: accountId,\n [ARN_ANNOTATION]: account.Arn || '',\n [ORGANIZATION_ANNOTATION]: organizationId,\n [ACCOUNT_EMAIL_ANNOTATION]: account.Email || '',\n },\n labels: {\n [ACCOUNT_STATUS_LABEL]: this.normalizeAccountStatus(\n account.Status || '',\n ),\n },\n name: this.normalizeName(account.Name || ''),\n title: account.Name || '',\n namespace: 'default',\n },\n spec: {\n type: 'cloud-account',\n owner: 'unknown',\n },\n };\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UrlReader } from '@backstage/backend-common';\nimport { isError } from '@backstage/errors';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n CatalogProcessorParser,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport limiterFactory from 'p-limit';\n\n/**\n * A processor for automatic discovery of entities from S3 buckets. Handles the\n * `s3-discovery` location type, and target bucket URLs e.g. on the form\n * `https://testbucket.s3.us-east-2.amazonaws.com`.\n *\n * @public\n * @deprecated Use the `AwsS3EntityProvider` instead (see https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-aws/CHANGELOG.md#014).\n */\nexport class AwsS3DiscoveryProcessor implements CatalogProcessor {\n constructor(private readonly reader: UrlReader) {}\n\n getProcessorName(): string {\n return 'AwsS3DiscoveryProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n optional: boolean,\n emit: CatalogProcessorEmit,\n parser: CatalogProcessorParser,\n ): Promise<boolean> {\n if (location.type !== 's3-discovery') {\n return false;\n }\n\n try {\n const output = await this.doRead(location.target);\n for (const item of output) {\n for await (const parseResult of parser({\n data: item.data,\n location: { type: location.type, target: item.url },\n })) {\n emit(parseResult);\n }\n }\n } catch (error) {\n const message = `Unable to read ${location.type}, ${error}`;\n\n if (isError(error) && error.name === 'NotFoundError') {\n if (!optional) {\n emit(processingResult.notFoundError(location, message));\n }\n } else {\n emit(processingResult.generalError(location, message));\n }\n }\n return true;\n }\n\n private async doRead(\n location: string,\n ): Promise<{ data: Buffer; url: string }[]> {\n const limiter = limiterFactory(5);\n const response = await this.reader.readTree(location);\n const responseFiles = await response.files();\n const output = responseFiles.map(async file => ({\n url: file.path,\n data: await limiter(file.content),\n }));\n return Promise.all(output);\n }\n}\n"],"names":["ANNOTATION_KUBERNETES_API_SERVER","ANNOTATION_KUBERNETES_API_SERVER_CA","ANNOTATION_KUBERNETES_AUTH_PROVIDER","ANNOTATION_KUBERNETES_AWS_CLUSTER_ID","DefaultAwsCredentialsManager","EKS","Organizations","processingResult","isError","limiterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,yBAAoC,GAAA,2BAAA;AAM1C,MAAM,kBAA6B,GAAA;;ACE7B,MAAA,kCAAA,GACX,OAAO,OAAA,EAAkB,SAAsB,KAAA;AAC7C,EAAA,MAAM,EAAE,GAAA,EAAK,QAAU,EAAA,oBAAA,EAAsB,MAAS,GAAA,OAAA,CAAA;AACtD,EAAM,MAAA,cAAA,GAAiB,cAAc,IAAc,CAAA,CAAA;AACnD,EAAO,OAAA;AAAA,IACL,UAAY,EAAA,uBAAA;AAAA,IACZ,IAAM,EAAA,UAAA;AAAA,IACN,QAAU,EAAA;AAAA,MACR,WAAa,EAAA;AAAA,QACX,CAAC,yBAAyB,GAAG,SAAA;AAAA,QAC7B,CAAC,kBAAkB,GAAG,GAAO,IAAA,EAAA;AAAA,QAC7B,CAACA,uDAAgC,GAAG,QAAY,IAAA,EAAA;A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ACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA,EAEA,MAAc,OACZ,QAC0C,EAAA;AAC1C,IAAM,MAAA,OAAA,GAAUE,gCAAe,CAAC,CAAA,CAAA;AAChC,IAAA,MAAM,QAAW,GAAA,MAAM,IAAK,CAAA,MAAA,CAAO,SAAS,QAAQ,CAAA,CAAA;AACpD,IAAM,MAAA,aAAA,GAAgB,MAAM,QAAA,CAAS,KAAM,EAAA,CAAA;AAC3C,IAAA,MAAM,MAAS,GAAA,aAAA,CAAc,GAAI,CAAA,OAAM,IAAS,MAAA;AAAA,MAC9C,KAAK,IAAK,CAAA,IAAA;AAAA,MACV,IAAM,EAAA,MAAM,OAAQ,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,KAChC,CAAA,CAAA,CAAA;AACF,IAAO,OAAA,OAAA,CAAQ,IAAI,MAAM,CAAA,CAAA;AAAA,GAC3B;AACF;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/constants.ts","../src/lib/defaultTransformers.ts","../src/processors/AwsEKSClusterProcessor.ts","../src/awsOrganization/config.ts","../src/processors/AwsOrganizationCloudAccountProcessor.ts","../src/processors/AwsS3DiscoveryProcessor.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying AWS account id\n *\n * @public\n */\nexport const ANNOTATION_AWS_ACCOUNT_ID: string = 'amazonaws.com/account-id';\n/**\n * Annotation for specifying AWS arn\n *\n * @public\n */\nexport const ANNOTATION_AWS_ARN: string = 'amazonaws.com/arn';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { type Cluster } from '@aws-sdk/client-eks';\nimport {\n ANNOTATION_KUBERNETES_API_SERVER,\n ANNOTATION_KUBERNETES_API_SERVER_CA,\n ANNOTATION_KUBERNETES_AUTH_PROVIDER,\n ANNOTATION_KUBERNETES_AWS_CLUSTER_ID,\n} from '@backstage/plugin-kubernetes-common';\nimport type { EksClusterEntityTransformer } from '../processors/types';\nimport { ANNOTATION_AWS_ACCOUNT_ID, ANNOTATION_AWS_ARN } from '../constants';\n\n/**\n * Default transformer for EKS Cluster to Resource Entity\n * @public\n */\nexport const defaultEksClusterEntityTransformer: EksClusterEntityTransformer =\n async (cluster: Cluster, accountId: string) => {\n const { arn, endpoint, certificateAuthority, name } = cluster;\n const normalizedName = normalizeName(name as string);\n return {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Resource',\n metadata: {\n annotations: {\n [ANNOTATION_AWS_ACCOUNT_ID]: accountId,\n [ANNOTATION_AWS_ARN]: arn || '',\n [ANNOTATION_KUBERNETES_API_SERVER]: endpoint || '',\n [ANNOTATION_KUBERNETES_API_SERVER_CA]:\n certificateAuthority?.data || '',\n [ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'aws',\n [ANNOTATION_KUBERNETES_AWS_CLUSTER_ID]: normalizedName,\n },\n name: normalizedName,\n namespace: 'default',\n },\n spec: {\n type: 'kubernetes-cluster',\n owner: 'unknown',\n },\n };\n };\n\nfunction normalizeName(name: string): string {\n return name\n .trim()\n .toLocaleLowerCase('en-US')\n .replace(/[^a-zA-Z0-9\\-]/g, '-');\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { EKS } from '@aws-sdk/client-eks';\nimport { AWSCredentialFactory } from '../types';\nimport { AwsCredentialIdentity, Provider } from '@aws-sdk/types';\nimport {\n AwsCredentialsManager,\n DefaultAwsCredentialsManager,\n} from '@backstage/integration-aws-node';\nimport { Config } from '@backstage/config';\n\nimport type { EksClusterEntityTransformer } from './types';\nimport { defaultEksClusterEntityTransformer } from '../lib';\n\n/**\n * A processor for automatic discovery of resources from EKS clusters. Handles the\n * `aws-eks` location type, and target accounts/regions of the form\n * `<accountId>/<region>`.\n *\n * @public\n */\nexport class AwsEKSClusterProcessor implements CatalogProcessor {\n private credentialsFactory?: AWSCredentialFactory;\n private credentialsManager?: AwsCredentialsManager;\n private readonly clusterEntityTransformer: EksClusterEntityTransformer;\n\n static fromConfig(\n configRoot: Config,\n options?: {\n clusterEntityTransformer?: EksClusterEntityTransformer;\n },\n ): AwsEKSClusterProcessor {\n const awsCredentaislManager =\n DefaultAwsCredentialsManager.fromConfig(configRoot);\n return new AwsEKSClusterProcessor({\n credentialsManager: awsCredentaislManager,\n ...options,\n });\n }\n\n constructor(options: {\n credentialsFactory?: AWSCredentialFactory;\n credentialsManager?: AwsCredentialsManager;\n clusterEntityTransformer?: EksClusterEntityTransformer;\n }) {\n this.credentialsFactory = options.credentialsFactory;\n this.credentialsManager = options.credentialsManager;\n\n // If the callback function is not passed in, then default to the one upstream is using\n this.clusterEntityTransformer =\n options.clusterEntityTransformer || defaultEksClusterEntityTransformer;\n }\n\n getProcessorName(): string {\n return 'aws-eks';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== 'aws-eks') {\n return false;\n }\n\n // location target is of format \"account-id/region\"\n const [accountId, region] = location.target.split('/');\n\n if (!accountId || !region) {\n throw new Error(\n 'AWS EKS location specified without account or region information',\n );\n }\n\n let credentials: AwsCredentialIdentity | undefined;\n\n if (this.credentialsFactory) {\n credentials = await this.credentialsFactory(accountId);\n }\n\n let providerFunction: (() => Provider<AwsCredentialIdentity>) | undefined;\n if (this.credentialsManager) {\n const credentialsProvider =\n await this.credentialsManager.getCredentialProvider({ accountId });\n providerFunction = () => credentialsProvider.sdkCredentialProvider;\n }\n\n const eksClient = new EKS({\n credentials,\n credentialDefaultProvider: providerFunction,\n region,\n });\n const clusters = await eksClient.listClusters({});\n if (clusters.clusters === undefined) {\n return true;\n }\n\n const results = clusters.clusters\n .map(cluster => eksClient.describeCluster({ name: cluster }))\n .map(async describedClusterPromise => {\n const describedCluster = await describedClusterPromise;\n if (describedCluster.cluster) {\n const entity = await this.clusterEntityTransformer(\n describedCluster.cluster,\n accountId,\n );\n\n emit({\n type: 'entity',\n entity,\n location,\n });\n }\n });\n await Promise.all(results);\n return true;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\n\n/**\n * The configuration parameters for a single AWS Organization Processor\n */\nexport type AwsOrganizationProviderConfig = {\n /**\n * The role to assume for the processor.\n */\n roleArn?: string;\n};\n\nexport function readAwsOrganizationConfig(\n config: Config,\n): AwsOrganizationProviderConfig {\n const providerConfig = config.getOptionalConfig('provider');\n\n const roleArn = providerConfig?.getOptionalString('roleArn');\n return {\n roleArn,\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceEntityV1alpha1 } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n Account,\n ListAccountsResponse,\n Organizations,\n} from '@aws-sdk/client-organizations';\nimport { readAwsOrganizationConfig } from '../awsOrganization/config';\nimport {\n AwsCredentialProvider,\n DefaultAwsCredentialsManager,\n} from '@backstage/integration-aws-node';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nconst AWS_ORGANIZATION_REGION = 'us-east-1';\nconst LOCATION_TYPE = 'aws-cloud-accounts';\n\nconst ACCOUNTID_ANNOTATION = 'amazonaws.com/account-id';\nconst ACCOUNT_EMAIL_ANNOTATION = 'amazonaws.com/account-email';\nconst ARN_ANNOTATION = 'amazonaws.com/arn';\nconst ORGANIZATION_ANNOTATION = 'amazonaws.com/organization-id';\n\nconst ACCOUNT_STATUS_LABEL = 'amazonaws.com/account-status';\n\n/**\n * A processor for ingesting AWS Accounts from AWS Organizations.\n *\n * If custom authentication is needed, it can be achieved by configuring the\n * global AWS.credentials object.\n *\n * @public\n */\nexport class AwsOrganizationCloudAccountProcessor implements CatalogProcessor {\n private readonly organizations: Organizations;\n private readonly logger: LoggerService;\n\n static async fromConfig(config: Config, options: { logger: LoggerService }) {\n const c = config.getOptionalConfig('catalog.processors.awsOrganization');\n const orgConfig = c ? readAwsOrganizationConfig(c) : undefined;\n const awsCredentialsManager =\n DefaultAwsCredentialsManager.fromConfig(config);\n const credProvider = await awsCredentialsManager.getCredentialProvider({\n arn: orgConfig?.roleArn,\n });\n return new AwsOrganizationCloudAccountProcessor(\n credProvider,\n options.logger,\n );\n }\n\n private constructor(\n private readonly credProvider: AwsCredentialProvider,\n logger: LoggerService,\n ) {\n this.logger = logger?.child({\n target: this.getProcessorName(),\n });\n this.organizations = new Organizations({\n credentialDefaultProvider: () => this.credProvider.sdkCredentialProvider,\n region: AWS_ORGANIZATION_REGION,\n }); // Only available in us-east-1\n }\n\n getProcessorName(): string {\n return 'AwsOrganizationCloudAccountProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== LOCATION_TYPE) {\n return false;\n }\n\n this.logger?.info('Discovering AWS Organization Account objects');\n\n (await this.getAwsAccounts())\n .map(account => this.mapAccountToComponent(account))\n .filter(entity => {\n if (location.target !== '') {\n if (entity.metadata.annotations) {\n return (\n entity.metadata.annotations[ORGANIZATION_ANNOTATION] ===\n location.target\n );\n }\n return false;\n }\n return true;\n })\n .forEach(entity => {\n emit(processingResult.entity(location, entity));\n });\n\n return true;\n }\n\n private normalizeName(name: string): string {\n return name\n .trim()\n .toLocaleLowerCase('en-US')\n .replace(/[^a-zA-Z0-9\\-]/g, '-');\n }\n\n private normalizeAccountStatus(name: string): string {\n return name.toLocaleLowerCase('en-US');\n }\n\n private extractInformationFromArn(arn: string): {\n accountId: string;\n organizationId: string;\n } {\n const parts = arn.split('/');\n\n return {\n accountId: parts[parts.length - 1],\n organizationId: parts[parts.length - 2],\n };\n }\n\n private async getAwsAccounts(): Promise<Account[]> {\n let awsAccounts: Account[] = [];\n let isInitialAttempt = true;\n let nextToken = undefined;\n while (isInitialAttempt || nextToken) {\n isInitialAttempt = false;\n const orgAccounts: ListAccountsResponse =\n await this.organizations.listAccounts({ NextToken: nextToken });\n if (orgAccounts.Accounts) {\n awsAccounts = awsAccounts.concat(orgAccounts.Accounts);\n }\n nextToken = orgAccounts.NextToken;\n }\n\n return awsAccounts;\n }\n\n private mapAccountToComponent(account: Account): ResourceEntityV1alpha1 {\n const { accountId, organizationId } = this.extractInformationFromArn(\n account.Arn as string,\n );\n return {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Resource',\n metadata: {\n annotations: {\n [ACCOUNTID_ANNOTATION]: accountId,\n [ARN_ANNOTATION]: account.Arn || '',\n [ORGANIZATION_ANNOTATION]: organizationId,\n [ACCOUNT_EMAIL_ANNOTATION]: account.Email || '',\n },\n labels: {\n [ACCOUNT_STATUS_LABEL]: this.normalizeAccountStatus(\n account.Status || '',\n ),\n },\n name: this.normalizeName(account.Name || ''),\n title: account.Name || '',\n namespace: 'default',\n },\n spec: {\n type: 'cloud-account',\n owner: 'unknown',\n },\n };\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UrlReader } from '@backstage/backend-common';\nimport { isError } from '@backstage/errors';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n CatalogProcessorParser,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport limiterFactory from 'p-limit';\n\n/**\n * A processor for automatic discovery of entities from S3 buckets. Handles the\n * `s3-discovery` location type, and target bucket URLs e.g. on the form\n * `https://testbucket.s3.us-east-2.amazonaws.com`.\n *\n * @public\n * @deprecated Use the `AwsS3EntityProvider` instead (see https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-aws/CHANGELOG.md#014).\n */\nexport class AwsS3DiscoveryProcessor implements CatalogProcessor {\n constructor(private readonly reader: UrlReader) {}\n\n getProcessorName(): string {\n return 'AwsS3DiscoveryProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n optional: boolean,\n emit: CatalogProcessorEmit,\n parser: CatalogProcessorParser,\n ): Promise<boolean> {\n if (location.type !== 's3-discovery') {\n return false;\n }\n\n try {\n const output = await this.doRead(location.target);\n for (const item of output) {\n for await (const parseResult of parser({\n data: item.data,\n location: { type: location.type, target: item.url },\n })) {\n emit(parseResult);\n }\n }\n } catch (error) {\n const message = `Unable to read ${location.type}, ${error}`;\n\n if (isError(error) && error.name === 'NotFoundError') {\n if (!optional) {\n emit(processingResult.notFoundError(location, message));\n }\n } else {\n emit(processingResult.generalError(location, message));\n }\n }\n return true;\n }\n\n private async doRead(\n location: string,\n ): Promise<{ data: Buffer; url: string }[]> {\n const limiter = limiterFactory(5);\n const response = await this.reader.readTree(location);\n const responseFiles = await response.files();\n const output = responseFiles.map(async file => ({\n url: file.path,\n data: await limiter(file.content),\n }));\n return Promise.all(output);\n }\n}\n"],"names":["ANNOTATION_KUBERNETES_API_SERVER","ANNOTATION_KUBERNETES_API_SERVER_CA","ANNOTATION_KUBERNETES_AUTH_PROVIDER","ANNOTATION_KUBERNETES_AWS_CLUSTER_ID","DefaultAwsCredentialsManager","EKS","Organizations","processingResult","isError","limiterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,yBAAoC,GAAA,2BAAA;AAM1C,MAAM,kBAA6B,GAAA;;ACE7B,MAAA,kCAAA,GACX,OAAO,OAAA,EAAkB,SAAsB,KAAA;AAC7C,EAAA,MAAM,EAAE,GAAA,EAAK,QAAU,EAA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AAA,CAAA;AAEzD,MAAA,IAAIC,cAAQ,CAAA,KAAK,CAAK,IAAA,KAAA,CAAM,SAAS,eAAiB,EAAA;AACpD,QAAA,IAAI,CAAC,QAAU,EAAA;AACb,UAAA,IAAA,CAAKD,kCAAiB,CAAA,aAAA,CAAc,QAAU,EAAA,OAAO,CAAC,CAAA,CAAA;AAAA,SACxD;AAAA,OACK,MAAA;AACL,QAAA,IAAA,CAAKA,kCAAiB,CAAA,YAAA,CAAa,QAAU,EAAA,OAAO,CAAC,CAAA,CAAA;AAAA,OACvD;AAAA,KACF;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA,EAEA,MAAc,OACZ,QAC0C,EAAA;AAC1C,IAAM,MAAA,OAAA,GAAUE,gCAAe,CAAC,CAAA,CAAA;AAChC,IAAA,MAAM,QAAW,GAAA,MAAM,IAAK,CAAA,MAAA,CAAO,SAAS,QAAQ,CAAA,CAAA;AACpD,IAAM,MAAA,aAAA,GAAgB,MAAM,QAAA,CAAS,KAAM,EAAA,CAAA;AAC3C,IAAA,MAAM,MAAS,GAAA,aAAA,CAAc,GAAI,CAAA,OAAM,IAAS,MAAA;AAAA,MAC9C,KAAK,IAAK,CAAA,IAAA;AAAA,MACV,IAAM,EAAA,MAAM,OAAQ,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,KAChC,CAAA,CAAA,CAAA;AACF,IAAO,OAAA,OAAA,CAAQ,IAAI,MAAM,CAAA,CAAA;AAAA,GAC3B;AACF;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -133,4 +133,10 @@ declare const ANNOTATION_AWS_ACCOUNT_ID: string;
|
|
|
133
133
|
*/
|
|
134
134
|
declare const ANNOTATION_AWS_ARN: string;
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Default transformer for EKS Cluster to Resource Entity
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
declare const defaultEksClusterEntityTransformer: EksClusterEntityTransformer;
|
|
141
|
+
|
|
142
|
+
export { ANNOTATION_AWS_ACCOUNT_ID, ANNOTATION_AWS_ARN, type AWSCredentialFactory, AwsEKSClusterProcessor, AwsOrganizationCloudAccountProcessor, AwsS3DiscoveryProcessor, AwsS3EntityProvider, type EksClusterEntityTransformer, defaultEksClusterEntityTransformer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-aws",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"description": "A Backstage catalog backend module that helps integrate towards AWS",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -56,25 +56,25 @@
|
|
|
56
56
|
"@aws-sdk/credential-providers": "^3.350.0",
|
|
57
57
|
"@aws-sdk/middleware-endpoint": "^3.347.0",
|
|
58
58
|
"@aws-sdk/types": "^3.347.0",
|
|
59
|
-
"@backstage/backend-common": "^0.23.
|
|
60
|
-
"@backstage/backend-plugin-api": "^0.
|
|
61
|
-
"@backstage/backend-tasks": "^0.5.
|
|
59
|
+
"@backstage/backend-common": "^0.23.3",
|
|
60
|
+
"@backstage/backend-plugin-api": "^0.7.0",
|
|
61
|
+
"@backstage/backend-tasks": "^0.5.27",
|
|
62
62
|
"@backstage/catalog-model": "^1.5.0",
|
|
63
63
|
"@backstage/config": "^1.2.0",
|
|
64
64
|
"@backstage/errors": "^1.2.4",
|
|
65
|
-
"@backstage/integration": "^1.
|
|
65
|
+
"@backstage/integration": "^1.13.0",
|
|
66
66
|
"@backstage/integration-aws-node": "^0.1.12",
|
|
67
|
-
"@backstage/plugin-catalog-common": "^1.0.
|
|
68
|
-
"@backstage/plugin-catalog-node": "^1.12.
|
|
69
|
-
"@backstage/plugin-kubernetes-common": "^0.8.
|
|
67
|
+
"@backstage/plugin-catalog-common": "^1.0.25",
|
|
68
|
+
"@backstage/plugin-catalog-node": "^1.12.4",
|
|
69
|
+
"@backstage/plugin-kubernetes-common": "^0.8.1",
|
|
70
70
|
"p-limit": "^3.0.2",
|
|
71
71
|
"uuid": "^9.0.0",
|
|
72
72
|
"winston": "^3.2.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@aws-sdk/util-stream-node": "^3.350.0",
|
|
76
|
-
"@backstage/backend-test-utils": "^0.4.
|
|
77
|
-
"@backstage/cli": "^0.26.
|
|
76
|
+
"@backstage/backend-test-utils": "^0.4.4",
|
|
77
|
+
"@backstage/cli": "^0.26.11",
|
|
78
78
|
"aws-sdk-client-mock": "^4.0.0",
|
|
79
79
|
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
80
80
|
"luxon": "^3.0.0",
|