CfnFunctionProps

class aws_cdk.aws_cloudfront.CfnFunctionProps(*, function_code, function_config, name, auto_publish=None, function_metadata=None)

Bases: object

Properties for defining a CfnFunction.

Parameters:
  • function_code (str) – The function code. For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide .

  • function_config (Union[IResolvable, FunctionConfigProperty, Dict[str, Any]]) – Contains configuration information about a CloudFront function.

  • name (str) – A name to identify the function.

  • auto_publish (Union[bool, IResolvable, None]) – A flag that determines whether to automatically publish the function to the LIVE stage when it’s created. To automatically publish to the LIVE stage, set this property to true .

  • function_metadata (Union[IResolvable, FunctionMetadataProperty, Dict[str, Any], None]) – Contains metadata about a CloudFront function.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_cloudfront as cloudfront

cfn_function_props = cloudfront.CfnFunctionProps(
    function_code="functionCode",
    function_config=cloudfront.CfnFunction.FunctionConfigProperty(
        comment="comment",
        runtime="runtime"
    ),
    name="name",

    # the properties below are optional
    auto_publish=False,
    function_metadata=cloudfront.CfnFunction.FunctionMetadataProperty(
        function_arn="functionArn"
    )
)

Attributes

auto_publish

A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.

To automatically publish to the LIVE stage, set this property to true .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-autopublish

function_code

The function code.

For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functioncode

function_config

Contains configuration information about a CloudFront function.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionconfig

function_metadata

Contains metadata about a CloudFront function.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionmetadata

name

A name to identify the function.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-name