import { BackendSecret, BackendSecretResolver } from '@aws-amplify/plugin-types'; import { FunctionProps } from './factory.js'; import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; import { FunctionEnvironmentTypeGenerator } from './function_env_type_generator.js'; /** * Translates function environment props into appropriate environment records and builds a policy statement * in order to resolve secrets in environment props. */ export declare class FunctionEnvironmentTranslator { private readonly lambda; private readonly functionEnvironmentProp; private readonly backendSecretResolver; private readonly functionEnvironmentTypeGenerator; private readonly ssmPaths; private readonly ssmEnvVars; private readonly amplifyBackendEnvVarNames; /** * Initialize translated environment variable records */ constructor(lambda: NodejsFunction, // we need to use a specific type here so that we have all the method goodies functionEnvironmentProp: Required['environment'], backendSecretResolver: BackendSecretResolver, functionEnvironmentTypeGenerator: FunctionEnvironmentTypeGenerator); /** * Adds an environment variable to the lambda to be used at runtime * @param key The environment variable name * @param value envVar value that can be a plain text or a secret */ addEnvironmentEntry: (key: string, value: string | BackendSecret) => void; /** * Adds an environment variable to the lambda whose value will be fetched from SSM at runtime * @param name The environment variable name * @param ssmPath The SSM path where the value is stored */ addSsmEnvironmentEntry: (name: string, ssmPath: string) => void; } /** * Defines metadata around environment variable values that are fetched from SSM during runtime of the lambda function */ export type SsmEnvVars = { /** * The environment variable name to place the resolved value in */ [name: string]: { /** * The record key names are the branch/sandbox specific SSM paths to fetch the value from */ path: string; /** * An optional "fallback" SSM path where the value will be looked up if not found at the branch-specific path */ sharedPath?: string; }; }; //# sourceMappingURL=function_env_translator.d.ts.map