Show / Hide Table of Contents

Class Function

A CloudFront Function.

Inheritance
object
Resource
Function
Implements
IFunction
IResource
IConstruct
IDependable
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
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

string

Remarks

Attribute: true

FunctionName

the name of the CloudFront function.

public virtual string FunctionName { get; }
Property Value

string

Remarks

Attribute: true

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
Constructs.IConstruct
Constructs.IDependable
Back to top Generated by DocFX