Class FunctionCode
Represents the function's source code.
Inheritance
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class FunctionCode : DeputyBase
Syntax (vb)
Public MustInherit Class FunctionCode
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var store = new KeyValueStore(this, "KeyValueStore");
new Function(this, "Function", new FunctionProps {
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
});
Synopsis
Constructors
Function |
|
Function |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Function |
Used by jsii to construct an instance of this class from DeputyProps |
Methods
From |
Code from external file for function. |
From |
Inline code for function. |
Render() | renders the function code. |
Constructors
FunctionCode()
protected FunctionCode()
FunctionCode(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected FunctionCode(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
FunctionCode(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected FunctionCode(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
Methods
FromFile(IFileCodeOptions)
Code from external file for function.
public static FunctionCode FromFile(IFileCodeOptions options)
Parameters
- options IFile
Code Options the options for the external file.
Returns
code object with contents from file.
FromInline(String)
Inline code for function.
public static FunctionCode FromInline(string code)
Parameters
- code System.
String The actual function code.
Returns
code object with inline code.
Render()
renders the function code.
public abstract string Render()
Returns
System.