Menu
Amazon CloudFront
Developer Guide (API Version 2016-09-29)

Troubleshooting Lambda@Edge

If your Lambda@Edge function is returning one of the following errors, you're still using the preview version of Lambda@Edge:

  • "The function has an invalid runtime ..."

  • "The function code size is too big ..."

  • "Invalid or unsupported region in the function ..."

To confirm that you're still using the preview version, check the following:

  • Your existing functions are coded using the Edge Node.js 4.3 runtime, which is no longer supported.

  • Your existing triggers reference the function only by name, which is no longer supported. Triggers must reference a numbered version of the function, for example:

    arn:aws:lambda:us-east-1:123456789012:function:http-redirect:1

You can continue to use the preview version of Lambda@Edge for a distribution until you delete all the triggers that are associated with the distribution. To add new triggers to the distribution, you must migrate from the preview version to the general availability version; you can't revert to the preview version.

To migrate from the preview version to the general availability version of Lambda@Edge for a distribution

  1. Use the CloudFront console to delete all the existing triggers for the distribution:

    1. Sign in to the AWS Management Console and open the CloudFront console at https://console.aws.amazon.com/cloudfront/.

    2. Choose the ID for the distribution that you want to update.

    3. Choose Behaviors.

    4. Select the check box for the cache behavior that you want to delete triggers for, and choose Edit.

    5. For Lambda Function Associations, choose the X next to each function association (trigger).

    6. After you remove all triggers, choose Yes, Edit.

    7. To delete triggers for other cache behaviors for this distribution, repeat steps 2d through 2f.

      After you delete all triggers for a distribution and save your changes, the triggers that you add to the distribution provide the general availability functionality of Lambda@Edge instead of the preview functionality.

  2. Use the Lambda console to create new versions of your functions. Note the following:

  3. Use the Lambda console to add CloudFront triggers to the new functions. The Lambda console allows you to test the triggers as you create them; this option isn't available if you create triggers in the CloudFront console. For more information, see Adding Triggers for a Lambda@Edge Function (AWS Lambda Console) in the AWS Lambda Developer Guide.