Skip to content
v2.274.0

FunctionRuntime Class ​

The function's runtime environment version.

Example ​

ts
const store = new cloudfront.KeyValueStore(this, 'KeyValueStore');
new cloudfront.Function(this, 'Function', {
  code: cloudfront.FunctionCode.fromInline('function handler(event) { return event.request }'),
  // Note that JS_2_0 must be used for Key Value Store support
  runtime: cloudfront.FunctionRuntime.JS_2_0,
  keyValueStore: store,
});

Properties ​

cloudfront-js-1.0.
cloudfront-js-2.0.
valuestringvaluestrvalueStringValuestringValue*stringrequired#

Methods ​

custom(runtimeString: string): FunctionRuntime // chainable@staticmethod def custom(runtime_string: str) -> FunctionRuntimepublic static FunctionRuntime custom(String runtimeString)public static FunctionRuntime Custom(string runtimeString)func Custom(RuntimeString *string) FunctionRuntimestatic#
A custom runtime string.

Gives full control over the runtime string fragment.