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.103.1 (build bef2dea)",
date="2024-09-11T18:01:12.609Z")
@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
ModifierConstructorDescriptionprotected
protected
FunctionCode
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
FunctionCode
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionCode
fromFile
(FileCodeOptions options) Code from external file for function.static FunctionCode
fromInline
(String code) Inline code for function.abstract String
render()
renders the function code.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
-
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.
-