java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.cloudfront.CfnFunctionPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:19:57.082Z") @Stability(Stable) public class CfnFunctionPropsMixin extends Mixin implements software.constructs.IMixin
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 .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.cloudfront.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnFunctionPropsMixin cfnFunctionPropsMixin = CfnFunctionPropsMixin.Builder.create(CfnFunctionMixinProps.builder()
         .autoPublish(false)
         .functionCode("functionCode")
         .functionConfig(FunctionConfigProperty.builder()
                 .comment("comment")
                 .keyValueStoreAssociations(List.of(KeyValueStoreAssociationProperty.builder()
                         .keyValueStoreArn("keyValueStoreArn")
                         .build()))
                 .runtime("runtime")
                 .build())
         .functionMetadata(FunctionMetadataProperty.builder()
                 .functionArn("functionArn")
                 .build())
         .name("name")
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnFunctionPropsMixin

      protected CfnFunctionPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnFunctionPropsMixin

      protected CfnFunctionPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnFunctionPropsMixin

      @Stability(Stable) public CfnFunctionPropsMixin(@NotNull CfnFunctionMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::CloudFront::Function.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnFunctionPropsMixin

      @Stability(Stable) public CfnFunctionPropsMixin(@NotNull CfnFunctionMixinProps props)
      Create a mixin to apply properties to AWS::CloudFront::Function.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnFunctionMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()