Creates a CloudFront function¶
Description¶
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 test_function, and update it with update_function.
When you're ready to use your function with a CloudFront distribution, use publish_function 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.
Usage¶
Arguments¶
-
Name[required] A name to identify the function.
-
FunctionConfig[required] Configuration information about the function, including an optional comment and the function's runtime.
-
FunctionCode[required] The function code. For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide.
-
TagsA complex type that contains zero or more
Tagelements.
Value¶
A list with the following syntax:
list(
FunctionSummary = list(
Name = "string",
Status = "string",
FunctionConfig = list(
Comment = "string",
Runtime = "cloudfront-js-1.0"|"cloudfront-js-2.0",
KeyValueStoreAssociations = list(
Quantity = 123,
Items = list(
list(
KeyValueStoreARN = "string"
)
)
)
),
FunctionMetadata = list(
FunctionARN = "string",
Stage = "DEVELOPMENT"|"LIVE",
CreatedTime = as.POSIXct(
"2015-01-01"
),
LastModifiedTime = as.POSIXct(
"2015-01-01"
)
)
),
Location = "string",
ETag = "string"
)
Request syntax¶
svc$create_function(
Name = "string",
FunctionConfig = list(
Comment = "string",
Runtime = "cloudfront-js-1.0"|"cloudfront-js-2.0",
KeyValueStoreAssociations = list(
Quantity = 123,
Items = list(
list(
KeyValueStoreARN = "string"
)
)
)
),
FunctionCode = raw,
Tags = list(
Items = list(
list(
Key = "string",
Value = "string"
)
)
)
)