View a markdown version of this page

Activating and managing Lambda SnapStart - AWS Lambda

Activating and managing Lambda SnapStart

To use SnapStart, activate SnapStart on a new or existing Lambda function. Then, publish and invoke a function version.

Activating SnapStart (console)

To activate SnapStart for a function
  1. Open the Functions page of the Lambda console.

  2. Choose the name of a function.

  3. Choose Configuration, and then choose General configuration.

  4. On the General configuration pane, choose Edit.

  5. On the Edit basic settings page, for SnapStart, choose Published versions.

  6. Choose Save.

  7. Publish a function version. Lambda initializes your code, creates a snapshot of the initialized execution environment, and then caches the snapshot for low-latency access.

  8. Invoke the function version.

Activating SnapStart (AWS CLI)

To activate SnapStart for an existing function
  1. Update the function configuration by running the update-function-configuration command with the --snap-start option.

    aws lambda update-function-configuration \ --function-name my-function \ --snap-start ApplyOn=PublishedVersions
  2. Publish a function version with the publish-version command.

    aws lambda publish-version \ --function-name my-function
  3. Confirm that SnapStart is activated for the function version by running the get-function-configuration command and specifying the version number. The following example specifies version 1.