import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
import { Config } from '@backstage/config';

/**
 * A set of credentials information for an AWS account.
 *
 * @public
 */
type AwsCredentialProvider = {
    /**
     * The AWS account ID of these credentials
     */
    accountId?: string;
    /**
     * The STS region used with these credentials
     */
    stsRegion?: string;
    /**
     * The credential identity provider to use when creating AWS SDK for Javascript V3 clients
     */
    sdkCredentialProvider: AwsCredentialIdentityProvider;
};
/**
 * The options for specifying the AWS credentials to retrieve.
 *
 * @public
 */
type AwsCredentialProviderOptions = {
    /**
     * The AWS account ID, e.g. '0123456789012'
     */
    accountId?: string;
    /**
     * The resource ARN that will be accessed with the returned credentials.
     * If account ID or region are not specified, they will be inferred from the ARN.
     */
    arn?: string;
};
/**
 * This allows implementations to be provided to retrieve AWS credentials.
 *
 * @public
 */
interface AwsCredentialsManager {
    /**
     * Get credentials for an AWS account.
     */
    getCredentialProvider(opts?: AwsCredentialProviderOptions): Promise<AwsCredentialProvider>;
}

/**
 * Handles the creation and caching of credential providers for AWS accounts.
 *
 * @public
 */
declare class DefaultAwsCredentialsManager implements AwsCredentialsManager {
    private readonly accountCredentialProviders;
    private readonly accountDefaults;
    private readonly mainAccountCredentialProvider;
    static fromConfig(config: Config): DefaultAwsCredentialsManager;
    private constructor();
    /**
     * Returns an {@link AwsCredentialProvider} for a given AWS account.
     *
     * @example
     * ```ts
     * const { provider } = await getCredentialProvider({
     *   accountId: '0123456789012',
     * })
     *
     * const { provider } = await getCredentialProvider({
     *   arn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service'
     * })
     * ```
     *
     * @param opts - the AWS account ID or AWS resource ARN
     * @returns A promise of {@link AwsCredentialProvider}.
     */
    getCredentialProvider(opts?: AwsCredentialProviderOptions): Promise<AwsCredentialProvider>;
}

export { AwsCredentialProvider, AwsCredentialProviderOptions, AwsCredentialsManager, DefaultAwsCredentialsManager };
