UNPKG

aws-cdk

Version:

AWS CDK CLI, the command line tool for CDK apps

43 lines (42 loc) 1.81 kB
import type { NodeHttpHandlerOptions } from '@smithy/node-http-handler'; import type { AwsCredentialIdentityProvider, Logger } from '@smithy/types'; import { ProxyAgent } from 'proxy-agent'; import type { SdkHttpOptions } from './sdk-provider'; /** * Behaviors to match AWS CLI * * See these links: * * https://docs.aws.amazon.com/cli/latest/topic/config-vars.html * https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html */ export declare class AwsCliCompatible { /** * Build an AWS CLI-compatible credential chain provider * * The credential chain returned by this function is always caching. */ static credentialChainBuilder(options?: CredentialChainOptions): Promise<AwsCredentialIdentityProvider>; static requestHandlerBuilder(options?: SdkHttpOptions): NodeHttpHandlerOptions; static proxyAgent(options: SdkHttpOptions): ProxyAgent; /** * Attempts to get the region from a number of sources and falls back to us-east-1 if no region can be found, * as is done in the AWS CLI. * * The order of priority is the following: * * 1. Environment variables specifying region, with both an AWS prefix and AMAZON prefix * to maintain backwards compatibility, and without `DEFAULT` in the name because * Lambda and CodeBuild set the $AWS_REGION variable. * 2. Regions listed in the Shared Ini Files - First checking for the profile provided * and then checking for the default profile. * 3. IMDS instance identity region from the Metadata Service. * 4. us-east-1 */ static region(maybeProfile?: string): Promise<string>; } export interface CredentialChainOptions { readonly profile?: string; readonly httpOptions?: SdkHttpOptions; readonly logger?: Logger; }