Skip to main content

functions

Creates, updates, deletes or gets a function resource or lists functions in a region

Overview

Namefunctions
TypeResource
DescriptionResource Type definition for AWS::CloudFront::Function
Idaws.cloudfront.functions

Fields

NameDatatypeDescription
auto_publishboolean
function_arnstring
function_codestring
function_configobject
function_metadataobject
namestring
stagestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, FunctionConfig, FunctionCode, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all functions in a region.

SELECT
region,
auto_publish,
function_arn,
function_code,
function_config,
function_metadata,
name,
stage
FROM aws.cloudfront.functions
;

Gets all properties from an individual function.

SELECT
region,
auto_publish,
function_arn,
function_code,
function_config,
function_metadata,
name,
stage
FROM aws.cloudfront.functions
WHERE data__Identifier = '<FunctionARN>';

INSERT example

Use the following StackQL query and manifest file to create a new function resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cloudfront.functions (
FunctionCode,
FunctionConfig,
Name,
region
)
SELECT
'{{ FunctionCode }}',
'{{ FunctionConfig }}',
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudfront.functions
WHERE data__Identifier = '<FunctionARN>'
AND region = 'us-east-1';

Permissions

To operate on the functions resource, the following permissions are required:

Create

cloudfront:CreateFunction,
cloudfront:PublishFunction,
cloudfront:DescribeFunction

Delete

cloudfront:DeleteFunction,
cloudfront:DescribeFunction

List

cloudfront:ListFunctions

Read

cloudfront:DescribeFunction,
cloudfront:GetFunction

Update

cloudfront:UpdateFunction,
cloudfront:PublishFunction,
cloudfront:DescribeFunction