Amplify Toolbox
    Preparing search index...
    type FunctionProps = {
        architecture?: FunctionArchitecture;
        bundling?: FunctionBundlingOptions;
        entry?: string;
        environment?: Record<string, string | BackendSecret>;
        ephemeralStorageSizeMB?: number;
        layers?: Record<string, string>;
        logging?: FunctionLoggingOptions;
        memoryMB?: number;
        name?: string;
        resourceGroupName?: AmplifyResourceGroupName;
        runtime?: NodeVersion;
        schedule?: FunctionSchedule | FunctionSchedule[];
        timeoutSeconds?: number;
    }
    Index

    Properties

    architecture?: FunctionArchitecture

    The architecture of the target platform for the lambda environment. Defaults to X86_64.

    Optionalentry

    entry?: string

    The path to the file that contains the function entry point. If this is a relative path, it is computed relative to the file where this function is defined

    Defaults to './handler.ts'

    environment?: Record<string, string | BackendSecret>

    Environment variables that will be available during function execution

    ephemeralStorageSizeMB?: number

    The size of the function's /tmp directory in MB. Must be a whole number.

    512
    
    layers?: Record<string, string>

    Attach Lambda layers to a function

    • A Lambda layer is represented by an object of key/value pair where the key is the module name that is exported from your layer and the value is the ARN of the layer. The key (module name) is used to externalize the module dependency so it doesn't get bundled with your lambda function
    • Maximum of 5 layers can be attached to a function and must be in the same region as the function.
    layers: {
    "@aws-lambda-powertools/logger": "arn:aws:lambda:<current-region>:094274105915:layer:AWSLambdaPowertoolsTypeScriptV2:11"
    },
    or
    layers: {
    "Sharp": "SharpLayer:1"
    },
    memoryMB?: number

    An amount of memory (RAM) to allocate to the function between 128 and 10240 MB. Must be a whole number. Default is 512MB.

    name?: string

    A name for the function. Defaults to the basename of the entry path if specified. If no entry is specified, defaults to the directory name in which this function is defined.

    Example: If entry is ./scheduled-db-backup.ts the name will default to "scheduled-db-backup" If entry is not set and the function is defined in amplify/functions/db-backup/resource.ts the name will default to "db-backup"

    resourceGroupName?: AmplifyResourceGroupName

    Group the function with existing Amplify resources or separate the function into its own group.

    'function' // grouping with other Amplify functions
    
    resourceGroupName: 'auth' // to group an auth trigger with an auth resource
    
    runtime?: NodeVersion

    Node runtime version for the lambda environment.

    Defaults to the oldest NodeJS LTS version. See https://nodejs.org/en/about/previous-releases

    A time interval string to periodically run the function. This can be either a string of "every <positive whole number><m (minute) or h (hour)>", "every day|week|month|year" or cron expression. Defaults to no scheduling for the function.

    schedule: "every 5m"
    
    schedule: "every week"
    
    schedule: "0 9 ? * 2 *" // every Monday at 9am
    
    timeoutSeconds?: number

    An amount of time in seconds between 1 second and 15 minutes. Must be a whole number. Default is 3 seconds.