@cumulus/aws-client
Version:
Utilities for working with AWS
79 lines • 2.4 kB
TypeScript
import { Readable } from 'stream';
import { AWSClientTypes } from './types';
export declare const inTestMode: () => boolean;
declare const localStackPorts: {
APIGatewayClient: number;
CloudFormation: number;
CloudWatchEvents: number;
DynamoDB: number;
DynamoDBClient: number;
DynamoDBStreamsClient: number;
EC2: number;
ECS: number;
ElasticsearchService: number;
firehose: number;
iam: number;
Kinesis: number;
KMS: number;
Lambda: number;
redshift: number;
route53: number;
S3: number;
SecretsManager: number;
ses: number;
SFN: number;
SNS: number;
SQS: number;
ssm: number;
STS: number;
};
/**
* Returns the proper endpoint for a given aws service
*
* @param {string} identifier - service name
* @returns {string} the localstack endpoint
*
* @private
*/
export declare function getLocalstackEndpoint(identifier: keyof typeof localStackPorts): string;
/**
* Create an AWS service object that talks to LocalStack.
*
* This function expects that the LOCALSTACK_HOST environment variable will be set.
*
* @param {Function} Service - an AWS service object constructor function
* @param {Object} options - options to pass to the service object constructor function
* @returns {Object} an AWS service object
*
* @private
*/
export declare function localStackAwsClientOptions<T>(Service: new (params: object) => T, options?: {
credentials?: object;
}): {
[key: string]: unknown;
};
/**
* Create an AWS service object that does not actually talk to AWS.
*
* @param {Function} Service - an AWS service object constructor function
* @param {Object} options - options to pass to the service object constructor function
* @returns {Object} an AWS service object
*
* @private
*/
export declare function getLocalstackAwsClientOptions<T extends AWSClientTypes>(Service: new (params: object) => T, options?: {
credentials?: object;
}): object;
/**
* Return a function that throws a ThrottlingException the first time it is called, then returns as
* normal any other times.
*
* @param {Function} fn
* @returns {Function}
*
* @private
*/
export declare const throttleOnce: (fn: (...args: unknown[]) => unknown) => (...args: unknown[]) => unknown;
export declare const streamToString: (stream: Readable) => Promise<unknown>;
export {};
//# sourceMappingURL=test-utils.d.ts.map