AWS Fundamentals Logo
AWS Fundamentals
AWS::CloudFront::Function

CloudFront Function

Creates 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...

Properties

5 configurable properties. 3 required. Click a row to see details.

Filter:
PropertyTypeFlags
FunctionCode
string
Required
FunctionConfig
FunctionConfig
Required
Name
string
RequiredCreate-only
AutoPublish
boolean
Write-only
FunctionMetadata
FunctionMetadata

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
FunctionARNstring-
Stagestring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
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"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

cloudfront:CreateFunctioncloudfront:PublishFunctioncloudfront:DescribeFunction

delete

cloudfront:DeleteFunctioncloudfront:DescribeFunction

list

cloudfront:ListFunctions

read

cloudfront:DescribeFunctioncloudfront:GetFunction

update

cloudfront:UpdateFunctioncloudfront:PublishFunctioncloudfront:DescribeFunction

Get the CloudFront Cheat Sheet

Everything you need to know about CloudFront on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceCloudFront
Properties7
Required3
TaggingNot supported
Primary IDFunctionARN

Supported Operations

CreateDeleteListReadUpdate

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

Name

External Links