@karmaniverous/get-dotenv
    Preparing search index...

    Function establishAwsSession

    • Internal

      Establish the AWS session of an invocation once: the first caller (the aws preSubcommand hook for aws <flags> <child>, else the afterResolve hook) resolves it with cfg (config plus the aws flags) and applies it to process.env and ctx.plugins.aws; every later caller of the same invocation gets that session back, so an aws child command keeps the session its parent established (#56).

      An invocation is one composed context: each run composes a new one.

      Parameters

      • ctx: GetDotenvCliCtx

        The invocation's host context.

      • cfg: {
            defaultRegion?: string;
            loginOnDemand?: boolean;
            profile?: string;
            profileFallbackKey?: string;
            profileKey?: string;
            region?: string;
            regionKey?: string;
            strategy?: "none" | "cli-export";
        }

        Plugin config with this invocation's aws flags applied.

        • OptionaldefaultRegion?: string

          Fallback region when region cannot be resolved from config/dotenv/AWS CLI.

        • OptionalloginOnDemand?: boolean

          When true, attempt aws sso login on-demand when credential export fails for an SSO profile.

        • Optionalprofile?: string

          Preferred AWS profile name (overrides dotenv-derived profile keys when set).

        • OptionalprofileFallbackKey?: string

          Dotenv/config fallback key for profile lookup (default AWS_PROFILE).

        • OptionalprofileKey?: string

          Dotenv/config key for local profile lookup (default AWS_LOCAL_PROFILE).

        • Optionalregion?: string

          Preferred AWS region (overrides dotenv-derived region key when set).

        • OptionalregionKey?: string

          Dotenv/config key for region lookup (default AWS_REGION).

        • Optionalstrategy?: "none" | "cli-export"

          Credential acquisition strategy.

          • 'cli-export': resolve via AWS CLI
          • 'none': skip credential resolution

      Returns Promise<AwsContext>

      The session.