Class FunctionCode
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.FunctionCode
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T13:51:58.281Z")
@Stability(Stable)
public abstract class FunctionCode
extends software.amazon.jsii.JsiiObject
Represents the function's source code.
Example:
KeyValueStore store = new KeyValueStore(this, "KeyValueStore");
Function.Builder.create(this, "Function")
.code(FunctionCode.fromInline("function handler(event) { return event.request }"))
// Note that JS_2_0 must be used for Key Value Store support
.runtime(FunctionRuntime.JS_2_0)
.keyValueStore(store)
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFunctionCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFunctionCode(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionCodefromFile(FileCodeOptions options) Code from external file for function.static FunctionCodefromInline(String code) Inline code for function.abstract Stringrender()renders the function code.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FunctionCode
protected FunctionCode(software.amazon.jsii.JsiiObjectRef objRef) -
FunctionCode
protected FunctionCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FunctionCode
@Stability(Stable) protected FunctionCode()
-
-
Method Details
-
fromFile
Code from external file for function.- Parameters:
options- the options for the external file. This parameter is required.- Returns:
- code object with contents from file.
-
fromInline
Inline code for function.- Parameters:
code- The actual function code. This parameter is required.- Returns:
- code object with inline code.
-
render
renders the function code.
-