Show / Hide Table of Contents

Class Function

A CloudFront Function.

Inheritance
object
Resource
Function
Implements
IFunction
IResource
IFunctionRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.With(params IMixin[])
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Function : Resource, IFunction, IResource, IFunctionRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class [Function] Inherits Resource Implements IFunction, IResource, IFunctionRef, IConstruct, IDependable, IEnvironmentAware
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.

FunctionRef

A reference to a Function resource.

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

string

Remarks

Attribute: true

FunctionName

the name of the CloudFront function.

public virtual string FunctionName { get; }
Property Value

string

Remarks

Attribute: true

FunctionRef

A reference to a Function resource.

public virtual IFunctionReference FunctionRef { get; }
Property Value

IFunctionReference

Remarks

Resource: AWS::CloudFront::Function

ExampleMetadata: infused

FunctionRuntime

the runtime of the CloudFront function.

public virtual string FunctionRuntime { get; }
Property Value

string

Remarks

Attribute: true

FunctionStage

the deployment stage of the CloudFront function.

public virtual string FunctionStage { get; }
Property Value

string

Remarks

Attribute: true

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

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

IFunction

Remarks

Resource: AWS::CloudFront::Function

ExampleMetadata: infused

Implements

IFunction
IResource
IFunctionRef
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX