Class CfnCachePolicy
A cache policy.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCachePolicy : CfnResource, IInspectable
Syntax (vb)
Public Class CfnCachePolicy
Inherits CfnResource
Implements IInspectable
Remarks
When it's attached to a cache behavior, the cache policy determines the following:
The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy
.
CloudformationResource: AWS::CloudFront::CachePolicy
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 cfnCachePolicy = new CfnCachePolicy(this, "MyCfnCachePolicy", new CfnCachePolicyProps {
CachePolicyConfig = new CachePolicyConfigProperty {
DefaultTtl = 123,
MaxTtl = 123,
MinTtl = 123,
Name = "name",
ParametersInCacheKeyAndForwardedToOrigin = new ParametersInCacheKeyAndForwardedToOriginProperty {
CookiesConfig = new CookiesConfigProperty {
CookieBehavior = "cookieBehavior",
// the properties below are optional
Cookies = new [] { "cookies" }
},
EnableAcceptEncodingGzip = false,
HeadersConfig = new HeadersConfigProperty {
HeaderBehavior = "headerBehavior",
// the properties below are optional
Headers = new [] { "headers" }
},
QueryStringsConfig = new QueryStringsConfigProperty {
QueryStringBehavior = "queryStringBehavior",
// the properties below are optional
QueryStrings = new [] { "queryStrings" }
},
// the properties below are optional
EnableAcceptEncodingBrotli = false
},
// the properties below are optional
Comment = "comment"
}
});
Synopsis
Constructors
CfnCachePolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnCachePolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnCachePolicy(Construct, String, ICfnCachePolicyProps) |
Properties
AttrId | The unique identifier for the cache policy. |
AttrLastModifiedTime | The date and time when the cache policy was last modified. |
CachePolicyConfig | The cache policy configuration. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnCachePolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnCachePolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnCachePolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnCachePolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnCachePolicy(Construct, String, ICfnCachePolicyProps)
public CfnCachePolicy(Construct scope, string id, ICfnCachePolicyProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnCachePolicyProps
Resource properties.
Properties
AttrId
The unique identifier for the cache policy.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
For example: 2766f7b2-75c5-41c6-8f06-bf4303a2f2f5
.
CloudformationAttribute: Id
AttrLastModifiedTime
The date and time when the cache policy was last modified.
public virtual string AttrLastModifiedTime { get; }
Property Value
System.String
Remarks
CloudformationAttribute: LastModifiedTime
CachePolicyConfig
The cache policy configuration.
public virtual object CachePolicyConfig { get; set; }
Property Value
System.Object
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
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>