Class Function
A CloudFront Function.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.AWS.CloudFront.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
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 }")
});
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
Function(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Function(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Function(Construct, String, IFunctionProps) |
Properties
FunctionArn | the ARN of the CloudFront function. |
FunctionName | the name of the CloudFront function. |
FunctionStage | the deployment stage of the CloudFront function. |
Methods
FromFunctionAttributes(Construct, String, IFunctionAttributes) | Imports a function by its name and ARN. |
Constructors
Function(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Function(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Function(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Function(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Function(Construct, String, IFunctionProps)
public Function(Construct scope, string id, IFunctionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IFunctionProps
Properties
FunctionArn
the ARN of the CloudFront function.
public virtual string FunctionArn { get; }
Property Value
System.String
Remarks
Attribute: true
FunctionName
the name of the CloudFront function.
public virtual string FunctionName { get; }
Property Value
System.String
Remarks
Attribute: true
FunctionStage
the deployment stage of the CloudFront function.
public virtual string FunctionStage { get; }
Property Value
System.String
Remarks
Attribute: true
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 Constructs.Construct
- id System.String
- attrs IFunctionAttributes
Returns