---
title: "POST /2020-05-31/function"
method: POST
path: "/2020-05-31/function"
---

# POST /2020-05-31/function

`POST /2020-05-31/function`

Creates a CloudFront function.

To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function.

When you create a function, it's in the `DEVELOPMENT` stage. In this stage, you can test the function with `TestFunction`, and update it with `UpdateFunction`.

When you're ready to use your function with a CloudFront distribution, use `PublishFunction` to copy the function from the `DEVELOPMENT` stage to `LIVE`. When it's live, you can attach the function to a distribution's cache behavior, using the function's ARN.

## Response `201`

Success

## Other responses

- `480` — TooManyFunctions
- `481` — FunctionAlreadyExists
- `482` — FunctionSizeLimitExceeded
- `483` — InvalidArgument
- `484` — UnsupportedOperation

---

[API](https://skmtc.net/aws/apis/cloudfront.md) · [All operations](https://skmtc.net/aws/apis/cloudfront/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/cloudfront/versions/fd674fc97471/schema)
