Class FunctionRuntime

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.FunctionRuntime
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:13.736Z") @Stability(Stable) public class FunctionRuntime extends software.amazon.jsii.JsiiObject
The function's runtime environment version.

Example:

 Bucket s3Bucket;
 // Add a cloudfront Function to a Distribution
 Function cfFunction = Function.Builder.create(this, "Function")
         .code(FunctionCode.fromInline("function handler(event) { return event.request }"))
         .runtime(FunctionRuntime.JS_2_0)
         .build();
 Distribution.Builder.create(this, "distro")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(new S3Origin(s3Bucket))
                 .functionAssociations(List.of(FunctionAssociation.builder()
                         .function(cfFunction)
                         .eventType(FunctionEventType.VIEWER_REQUEST)
                         .build()))
                 .build())
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FunctionRuntime
    cloudfront-js-1.0.
    static final FunctionRuntime
    cloudfront-js-2.0.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    FunctionRuntime(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    FunctionRuntime(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    custom(String runtimeString)
    A custom runtime string.
     

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • JS_1_0

      @Stability(Stable) public static final FunctionRuntime JS_1_0
      cloudfront-js-1.0.
    • JS_2_0

      @Stability(Stable) public static final FunctionRuntime JS_2_0
      cloudfront-js-2.0.
  • Constructor Details

    • FunctionRuntime

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

      protected FunctionRuntime(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • custom

      @Stability(Stable) @NotNull public static FunctionRuntime custom(@NotNull String runtimeString)
      A custom runtime string.

      Gives full control over the runtime string fragment.

      Parameters:
      runtimeString - This parameter is required.
    • getValue

      @Stability(Stable) @NotNull public String getValue()