Class CfnFunction
A CloudFormation AWS::CloudFront::Function
.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.AWS.CloudFront.dll
Syntax (csharp)
public class CfnFunction : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnFunction
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Creates a CloudFront function.
To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function, and the function’s stage.
By default, when you create a function, it’s in the DEVELOPMENT
stage. In this stage, you can test the function in the CloudFront console (or with TestFunction
in the CloudFront API).
When you’re ready to use your function with a CloudFront distribution, publish the function to the LIVE
stage. You can do this in the CloudFront console, with PublishFunction
in the CloudFront API, or by updating the AWS::CloudFront::Function
resource with the AutoPublish
property set to true
. When the function is published to the LIVE
stage, you can attach it to a distribution’s cache behavior, using the function’s ARN.
To automatically publish the function to the LIVE
stage when it’s created, set the AutoPublish
property to true
.
CloudformationResource: AWS::CloudFront::Function
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
var cfnFunction = new CfnFunction(this, "MyCfnFunction", new CfnFunctionProps {
FunctionCode = "functionCode",
FunctionConfig = new FunctionConfigProperty {
Comment = "comment",
Runtime = "runtime"
},
Name = "name",
// the properties below are optional
AutoPublish = false,
FunctionMetadata = new FunctionMetadataProperty {
FunctionArn = "functionArn"
}
});
Synopsis
Constructors
CfnFunction(Construct, String, ICfnFunctionProps) | Create a new |
CfnFunction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnFunction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrFunctionArn | The ARN of the function. For example:. |
AttrFunctionMetadataFunctionArn | The Amazon Resource Name (ARN) of the function. |
AttrStage | |
AutoPublish | A flag that determines whether to automatically publish the function to the |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
FunctionCode | The function code. |
FunctionConfig | Contains configuration information about a CloudFront function. |
FunctionMetadata | Contains metadata about a CloudFront function. |
Name | A name to identify the function. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnFunction(Construct, String, ICfnFunctionProps)
Create a new AWS::CloudFront::Function
.
public CfnFunction(Construct scope, string id, ICfnFunctionProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnFunctionProps
- resource properties.
CfnFunction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnFunction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnFunction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnFunction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrFunctionArn
The ARN of the function. For example:.
public virtual string AttrFunctionArn { get; }
Property Value
System.String
Remarks
arn:aws:cloudfront::123456789012:function/ExampleFunction
.
To get the function ARN, use the following syntax:
!GetAtt Function_Logical_ID .FunctionMetadata.FunctionARN
CloudformationAttribute: FunctionARN
AttrFunctionMetadataFunctionArn
The Amazon Resource Name (ARN) of the function.
public virtual string AttrFunctionMetadataFunctionArn { get; }
Property Value
System.String
Remarks
The ARN uniquely identifies the function.
CloudformationAttribute: FunctionMetadata.FunctionARN
AttrStage
public virtual string AttrStage { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Stage
AutoPublish
A flag that determines whether to automatically publish the function to the LIVE
stage when it’s created.
public virtual object AutoPublish { get; set; }
Property Value
System.Object
Remarks
To automatically publish to the LIVE
stage, set this property to true
.
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
FunctionCode
The function code.
public virtual string FunctionCode { get; set; }
Property Value
System.String
Remarks
For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide .
FunctionConfig
Contains configuration information about a CloudFront function.
public virtual object FunctionConfig { get; set; }
Property Value
System.Object
Remarks
FunctionMetadata
Contains metadata about a CloudFront function.
public virtual object FunctionMetadata { get; set; }
Property Value
System.Object
Remarks
Name
A name to identify the function.
public virtual string Name { get; set; }
Property Value
System.String
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>