address review comments

Signed-off-by: Jonah Back <jonah@jonahback.com>
This commit is contained in:
Jonah Back
2022-06-26 13:35:03 -07:00
parent 7365cccad2
commit 5151daee5e
5 changed files with 35 additions and 0 deletions
@@ -7,6 +7,7 @@ import { CatalogProcessor } from '@backstage/plugin-catalog-backend';
import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
import { CatalogProcessorParser } from '@backstage/plugin-catalog-backend';
import { Config } from '@backstage/config';
import { Credentials } from 'aws-sdk';
import { EntityProvider } from '@backstage/plugin-catalog-backend';
import { EntityProviderConnection } from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-backend';
@@ -14,6 +15,26 @@ import { Logger } from 'winston';
import { TaskRunner } from '@backstage/backend-tasks';
import { UrlReader } from '@backstage/backend-common';
// @public
export type AWSCredentialFactory = (
awsAccountId: string,
) => Promise<Credentials>;
// @public
export class AwsEKSClusterProcessor implements CatalogProcessor {
constructor(options: { credentialsFactory?: AWSCredentialFactory });
// (undocumented)
getProcessorName(): string;
// (undocumented)
normalizeName(name: string): string;
// (undocumented)
readLocation(
location: LocationSpec,
_optional: boolean,
emit: CatalogProcessorEmit,
): Promise<boolean>;
}
// @public
export class AwsOrganizationCloudAccountProcessor implements CatalogProcessor {
// (undocumented)
@@ -22,3 +22,4 @@
export * from './processors';
export * from './providers';
export * from './types';
@@ -29,6 +29,13 @@ import { AWSCredentialFactory } from '../types';
const ACCOUNTID_ANNOTATION: string = 'amazonaws.com/account-id';
const ARN_ANNOTATION: string = 'amazonaws.com/arn';
/**
* A processor for automatic discovery of resources from EKS clusters. Handles the
* `aws-eks` location type, and target accounts/regions of the form
* `<accountId>/<region>`.
*
* @public
*/
export class AwsEKSClusterProcessor implements CatalogProcessor {
private credentialsFactory?: AWSCredentialFactory;
@@ -14,5 +14,6 @@
* limitations under the License.
*/
export { AwsEKSClusterProcessor } from './AwsEKSClusterProcessor';
export { AwsOrganizationCloudAccountProcessor } from './AwsOrganizationCloudAccountProcessor';
export { AwsS3DiscoveryProcessor } from './AwsS3DiscoveryProcessor';
@@ -15,6 +15,11 @@
*/
import { Credentials } from 'aws-sdk';
/**
* A factory for providing user-specified AWS credentials for a given AWS account.
*
* @public
*/
export type AWSCredentialFactory = (
awsAccountId: string,
) => Promise<Credentials>;