CfnFunctionPropsMixin
- class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnFunctionPropsMixin(props, *, strategy=None)
Bases:
MixinCreates 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
DEVELOPMENTstage. In this stage, you can test the function in the CloudFront console (or withTestFunctionin the CloudFront API).When you’re ready to use your function with a CloudFront distribution, publish the function to the
LIVEstage. You can do this in the CloudFront console, withPublishFunctionin the CloudFront API, or by updating theAWS::CloudFront::Functionresource with theAutoPublishproperty set totrue. When the function is published to theLIVEstage, you can attach it to a distribution’s cache behavior, using the function’s ARN.To automatically publish the function to the
LIVEstage when it’s created, set theAutoPublishproperty totrue.- 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:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
FunctionConfigProperty
- class CfnFunctionPropsMixin.FunctionConfigProperty(*, comment=None, key_value_store_associations=None, runtime=None)
Bases:
objectContains 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:
- 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.
- key_value_store_associations
The configuration for the key value store associations.
- runtime
The function’s runtime environment version.
FunctionMetadataProperty
- class CfnFunctionPropsMixin.FunctionMetadataProperty(*, function_arn=None)
Bases:
objectContains 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:
- 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.
KeyValueStoreAssociationProperty
- class CfnFunctionPropsMixin.KeyValueStoreAssociationProperty(*, key_value_store_arn=None)
Bases:
objectThe key value store association.
- Parameters:
key_value_store_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the key value store association.- See:
- 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.