Class FunctionRuntime
The function's runtime environment version.
Inheritance
System.Object
FunctionRuntime
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class FunctionRuntime : DeputyBase
Syntax (vb)
Public Class FunctionRuntime
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
Bucket s3Bucket;
// Add a cloudfront Function to a Distribution
var cfFunction = new Function(this, "Function", new FunctionProps {
Code = FunctionCode.FromInline("function handler(event) { return event.request }"),
Runtime = FunctionRuntime.JS_2_0
});
new Distribution(this, "distro", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new S3Origin(s3Bucket),
FunctionAssociations = new [] { new FunctionAssociation {
Function = cfFunction,
EventType = FunctionEventType.VIEWER_REQUEST
} }
}
});
Synopsis
Constructors
FunctionRuntime(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
FunctionRuntime(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
JS_1_0 | cloudfront-js-1.0. |
JS_2_0 | cloudfront-js-2.0. |
Value |
Methods
Custom(String) | A custom runtime string. |
Constructors
FunctionRuntime(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected FunctionRuntime(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
FunctionRuntime(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected FunctionRuntime(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
JS_1_0
JS_2_0
Value
public virtual string Value { get; }
Property Value
System.String
Methods
Custom(String)
A custom runtime string.
public static FunctionRuntime Custom(string runtimeString)
Parameters
- runtimeString System.String
Returns
Remarks
Gives full control over the runtime string fragment.