CfnFunctionPropsMixin

class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnFunctionPropsMixin(props, *, strategy=None)

Bases: Mixin

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, 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 in the CloudFront console (or with TestFunction in the CloudFront API).

When you’re ready to use your function with a CloudFront distribution, publish the function to the LIVE stage. You can do this in the CloudFront console, with PublishFunction in the CloudFront API, or by updating the AWS::CloudFront::Function resource with the AutoPublish property set to true . When the function is published to the LIVE stage, you can attach it to a distribution’s cache behavior, using the function’s ARN.

To automatically publish the function to the LIVE stage when it’s created, set the AutoPublish property to true .

See:

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

CloudformationResource:

AWS::CloudFront::Function

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

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

cfn_function_props_mixin = cloudfront_mixins.CfnFunctionPropsMixin(cloudfront_mixins.CfnFunctionMixinProps(
    auto_publish=False,
    function_code="functionCode",
    function_config=cloudfront_mixins.CfnFunctionPropsMixin.FunctionConfigProperty(
        comment="comment",
        key_value_store_associations=[cloudfront_mixins.CfnFunctionPropsMixin.KeyValueStoreAssociationProperty(
            key_value_store_arn="keyValueStoreArn"
        )],
        runtime="runtime"
    ),
    function_metadata=cloudfront_mixins.CfnFunctionPropsMixin.FunctionMetadataProperty(
        function_arn="functionArn"
    ),
    name="name"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::CloudFront::Function.

Parameters:
  • props (Union[CfnFunctionMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['autoPublish', 'functionCode', 'functionConfig', 'functionMetadata', 'name']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

FunctionConfigProperty

class CfnFunctionPropsMixin.FunctionConfigProperty(*, comment=None, key_value_store_associations=None, runtime=None)

Bases: object

Contains configuration information about a CloudFront function.

Parameters:
  • comment (Optional[str]) – A comment to describe the function.

  • key_value_store_associations (Union[IResolvable, Sequence[Union[IResolvable, KeyValueStoreAssociationProperty, Dict[str, Any]]], None]) – The configuration for the key value store associations.

  • runtime (Optional[str]) – The function’s runtime environment version.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

function_config_property = cloudfront_mixins.CfnFunctionPropsMixin.FunctionConfigProperty(
    comment="comment",
    key_value_store_associations=[cloudfront_mixins.CfnFunctionPropsMixin.KeyValueStoreAssociationProperty(
        key_value_store_arn="keyValueStoreArn"
    )],
    runtime="runtime"
)

Attributes

comment

A comment to describe the function.

See:

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

key_value_store_associations

The configuration for the key value store associations.

See:

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

runtime

The function’s runtime environment version.

See:

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

FunctionMetadataProperty

class CfnFunctionPropsMixin.FunctionMetadataProperty(*, function_arn=None)

Bases: object

Contains metadata about a CloudFront function.

Parameters:

function_arn (Optional[str]) – The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

function_metadata_property = cloudfront_mixins.CfnFunctionPropsMixin.FunctionMetadataProperty(
    function_arn="functionArn"
)

Attributes

function_arn

The Amazon Resource Name (ARN) of the function.

The ARN uniquely identifies the function.

See:

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

KeyValueStoreAssociationProperty

class CfnFunctionPropsMixin.KeyValueStoreAssociationProperty(*, key_value_store_arn=None)

Bases: object

The key value store association.

Parameters:

key_value_store_arn (Optional[str]) – The Amazon Resource Name (ARN) of the key value store association.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

key_value_store_association_property = cloudfront_mixins.CfnFunctionPropsMixin.KeyValueStoreAssociationProperty(
    key_value_store_arn="keyValueStoreArn"
)

Attributes

key_value_store_arn

The Amazon Resource Name (ARN) of the key value store association.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html#cfn-cloudfront-function-keyvaluestoreassociation-keyvaluestorearn