Managing functions in CloudFront Functions - Amazon CloudFront

Managing functions in CloudFront Functions

With CloudFront Functions, you can write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. After you write the function code, the following topics can help you create the function in CloudFront Functions, test it, update it, publish it, and associate it with a CloudFront distribution.

The full procedure for deploying a function is the following:

  • Create the function. The function is initially created in with sample function code. This code is valid, even in the live stage. The function exists in the Development stage.

  • Test, update, associate. When the function is in the Development stage, you can test the function, and update it (including associating a key value store with it).

  • Publish. When you're ready to use your function with a CloudFront distribution, you publish the function, which copies it from the DEVELOPMENT stage to LIVE.

  • Associate with a distibution. When the function is in the LIVE stage, you can associate the function with a distribution's cache behavior.

Most of the information is repeated from the request. Other information is added by CloudFront. Note the following:

  • ETag: This value changes each time you modify the key value store.

  • FunctionARN

  • Stage

  • Status