Class Function
A CloudFront Function.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Function : Resource, IFunction, IResource, IConstruct, IDependable
Syntax (vb)
Public Class [Function] Inherits Resource Implements IFunction, IResource, IConstruct, IDependable
Remarks
Resource: AWS::CloudFront::Function
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(Construct, string, IFunctionProps) | A CloudFront Function. |
Properties
FunctionArn | the ARN of the CloudFront function. |
FunctionName | the name of the CloudFront function. |
FunctionRuntime | the runtime of the CloudFront function. |
FunctionStage | the deployment stage of the CloudFront function. |
PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Methods
FromFunctionAttributes(Construct, string, IFunctionAttributes) | Imports a function by its name and ARN. |
Constructors
Function(Construct, string, IFunctionProps)
A CloudFront Function.
public Function(Construct scope, string id, IFunctionProps props)
Parameters
- scope Construct
- id string
- props IFunctionProps
Remarks
Resource: AWS::CloudFront::Function
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
});
Properties
FunctionArn
the ARN of the CloudFront function.
public virtual string FunctionArn { get; }
Property Value
Remarks
Attribute: true
FunctionName
the name of the CloudFront function.
public virtual string FunctionName { get; }
Property Value
Remarks
Attribute: true
FunctionRuntime
the runtime of the CloudFront function.
public virtual string FunctionRuntime { get; }
Property Value
Remarks
Attribute: true
FunctionStage
the deployment stage of the CloudFront function.
public virtual string FunctionStage { get; }
Property Value
Remarks
Attribute: true
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Resource: AWS::CloudFront::Function
ExampleMetadata: infused
Methods
FromFunctionAttributes(Construct, string, IFunctionAttributes)
Imports a function by its name and ARN.
public static IFunction FromFunctionAttributes(Construct scope, string id, IFunctionAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IFunctionAttributes
Returns
Remarks
Resource: AWS::CloudFront::Function
ExampleMetadata: infused