AWS::CloudFront::FunctionCreates a CF 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, and the function’s stage. By default, when you create a function, it’s in the DEVELOPMENT stage. In this stage, you can [test the function](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/test-function.html) in the CF console (or with TestFunction...
5 configurable properties. 3 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
FunctionCode | string | Required |
FunctionConfig | FunctionConfig | Required |
Name | string | RequiredCreate-only |
AutoPublish | boolean | Write-only |
FunctionMetadata | FunctionMetadata |
Values returned after the resource is created. Access these with Fn::GetAtt.
| Attribute | Type | Description |
|---|---|---|
FunctionARN | string | - |
Stage | string | - |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::CloudFront::Function
Resources:
MyResource:
Type: AWS::CloudFront::Function
Properties:
Name: "my-name"
FunctionConfig: "value"
FunctionCode: "value"Permissions CloudFormation needs in your IAM role to manage this resource.
cloudfront:CreateFunctioncloudfront:PublishFunctioncloudfront:DescribeFunctioncloudfront:DeleteFunctioncloudfront:DescribeFunctioncloudfront:ListFunctionscloudfront:DescribeFunctioncloudfront:GetFunctioncloudfront:UpdateFunctioncloudfront:PublishFunctioncloudfront:DescribeFunctionEverything you need to know about CloudFront on one page. HD quality, print-friendly.
Download Free InfographicFunctionARNThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
Name