Class CfnCachePolicy
A cache policy.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCachePolicy : CfnResource, IInspectable, ICachePolicyRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnCachePolicy Inherits CfnResource Implements IInspectable, ICachePolicyRef, IConstruct, IDependable, IEnvironmentAware
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(Construct, string, ICfnCachePolicyProps) | Create a new |
Properties
| AttrId | The unique identifier for the cache policy. |
| AttrLastModifiedTime | The date and time when the cache policy was last modified. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| CachePolicyConfig | The cache policy configuration. |
| CachePolicyRef | A reference to a CachePolicy resource. |
| CfnProperties | A cache policy. |
Methods
| ArnForCachePolicy(ICachePolicyRef) | A cache policy. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnCachePolicy(object) | Checks whether the given object is a CfnCachePolicy. |
| RenderProperties(IDictionary<string, object>) | A cache policy. |
Constructors
CfnCachePolicy(Construct, string, ICfnCachePolicyProps)
Create a new AWS::CloudFront::CachePolicy.
public CfnCachePolicy(Construct scope, string id, ICfnCachePolicyProps props)
Parameters
- scope Construct
Scope in which this resource is defined.
- id string
Construct identifier for this resource (unique in its scope).
- props ICfnCachePolicyProps
Resource properties.
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
Properties
AttrId
The unique identifier for the cache policy.
public virtual string AttrId { get; }
Property Value
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
Remarks
CloudformationAttribute: LastModifiedTime
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
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
CachePolicyConfig
The cache policy configuration.
public virtual object CachePolicyConfig { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnCachePolicy.ICachePolicyConfigProperty
CachePolicyRef
A reference to a CachePolicy resource.
public virtual ICachePolicyReference CachePolicyRef { get; }
Property Value
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
CfnProperties
A cache policy.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
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
Methods
ArnForCachePolicy(ICachePolicyRef)
A cache policy.
public static string ArnForCachePolicy(ICachePolicyRef resource)
Parameters
- resource ICachePolicyRef
Returns
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"
}
});
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.
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
IsCfnCachePolicy(object)
Checks whether the given object is a CfnCachePolicy.
public static bool IsCfnCachePolicy(object x)
Parameters
- x object
Returns
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
RenderProperties(IDictionary<string, object>)
A cache policy.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
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