CacheSettingsProperty Struct
CacheSettings is a property of the AWS::Lightsail::Distribution resource. It describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution.
These settings apply only to your distribution’s CacheBehaviors that have a Behavior of cache . This includes the DefaultCacheBehavior .
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cacheSettingsProperty: lightsail.CfnDistribution.CacheSettingsProperty = {
allowedHttpMethods: 'allowedHttpMethods',
cachedHttpMethods: 'cachedHttpMethods',
defaultTtl: 123,
forwardedCookies: {
cookiesAllowList: ['cookiesAllowList'],
option: 'option',
},
forwardedHeaders: {
headersAllowList: ['headersAllowList'],
option: 'option',
},
forwardedQueryStrings: {
option: false,
queryStringsAllowList: ['queryStringsAllowList'],
},
maximumTtl: 123,
minimumTtl: 123,
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lightsail as lightsail
cache_settings_property = lightsail.CfnDistribution.CacheSettingsProperty(
allowed_http_methods="allowedHttpMethods",
cached_http_methods="cachedHttpMethods",
default_ttl=123,
forwarded_cookies=lightsail.CfnDistribution.CookieObjectProperty(
cookies_allow_list=["cookiesAllowList"],
option="option"
),
forwarded_headers=lightsail.CfnDistribution.HeaderObjectProperty(
headers_allow_list=["headersAllowList"],
option="option"
),
forwarded_query_strings=lightsail.CfnDistribution.QueryStringObjectProperty(
option=False,
query_strings_allow_list=["queryStringsAllowList"]
),
maximum_ttl=123,
minimum_ttl=123
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lightsail.*;
CacheSettingsProperty cacheSettingsProperty = CacheSettingsProperty.builder()
.allowedHttpMethods("allowedHttpMethods")
.cachedHttpMethods("cachedHttpMethods")
.defaultTtl(123)
.forwardedCookies(CookieObjectProperty.builder()
.cookiesAllowList(List.of("cookiesAllowList"))
.option("option")
.build())
.forwardedHeaders(HeaderObjectProperty.builder()
.headersAllowList(List.of("headersAllowList"))
.option("option")
.build())
.forwardedQueryStrings(QueryStringObjectProperty.builder()
.option(false)
.queryStringsAllowList(List.of("queryStringsAllowList"))
.build())
.maximumTtl(123)
.minimumTtl(123)
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lightsail;
var cacheSettingsProperty = new CacheSettingsProperty {
AllowedHttpMethods = "allowedHttpMethods",
CachedHttpMethods = "cachedHttpMethods",
DefaultTtl = 123,
ForwardedCookies = new CookieObjectProperty {
CookiesAllowList = new [] { "cookiesAllowList" },
Option = "option"
},
ForwardedHeaders = new HeaderObjectProperty {
HeadersAllowList = new [] { "headersAllowList" },
Option = "option"
},
ForwardedQueryStrings = new QueryStringObjectProperty {
Option = false,
QueryStringsAllowList = new [] { "queryStringsAllowList" }
},
MaximumTtl = 123,
MinimumTtl = 123
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cacheSettingsProperty := &CacheSettingsProperty{
AllowedHttpMethods: jsii.String("allowedHttpMethods"),
CachedHttpMethods: jsii.String("cachedHttpMethods"),
DefaultTtl: jsii.Number(123),
ForwardedCookies: &CookieObjectProperty{
CookiesAllowList: []*string{
jsii.String("cookiesAllowList"),
},
Option: jsii.String("option"),
},
ForwardedHeaders: &HeaderObjectProperty{
HeadersAllowList: []*string{
jsii.String("headersAllowList"),
},
Option: jsii.String("option"),
},
ForwardedQueryStrings: &QueryStringObjectProperty{
Option: jsii.Boolean(false),
QueryStringsAllowList: []*string{
jsii.String("queryStringsAllowList"),
},
},
MaximumTtl: jsii.Number(123),
MinimumTtl: jsii.Number(123),
}
Properties
allowedHttpMethodsoptionalstringallowed_http_methodsoptionalstrallowedHttpMethodsoptionalStringAllowedHttpMethodsoptionalstringAllowedHttpMethodsoptional*string #notes
You can specify the following options:
GET,HEAD- The distribution forwards theGETandHEADmethods.GET,HEAD,OPTIONS- The distribution forwards theGET,HEAD, andOPTIONSmethods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE- The distribution forwards theGET,HEAD,OPTIONS,PUT,PATCH,POST, andDELETEmethods.
If you specify GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE , you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.
cachedHttpMethodsoptionalstringcached_http_methodsoptionalstrcachedHttpMethodsoptionalStringCachedHttpMethodsoptionalstringCachedHttpMethodsoptional*string #You can specify the following options:
GET,HEAD- The distribution caches responses to theGETandHEADmethods.GET,HEAD,OPTIONS- The distribution caches responses to theGET,HEAD, andOPTIONSmethods.
defaultTtloptionalnumberdefault_ttloptionalint | floatdefaultTtloptionalNumberDefaultTtloptionaldoubleDefaultTtloptional*float64 #The value specified applies only when the origin does not add HTTP headers such as
Cache-Control max-age,Cache-Control s-maxage, andExpiresto objects.
forwardedCookiesoptionalIResolvable | CfnDistribution.forwarded_cookiesoptionaltyping.Union[IResolvable, CookieObjectProperty]forwardedCookiesoptionalIResolvableForwardedCookiesoptionalIResolvableForwardedCookiesoptionalinterface{} #Your content is cached based on the cookies that are forwarded.
forwardedHeadersoptionalIResolvable | CfnDistribution.forwarded_headersoptionaltyping.Union[IResolvable, HeaderObjectProperty]forwardedHeadersoptionalIResolvableForwardedHeadersoptionalIResolvableForwardedHeadersoptionalinterface{} #Your content is cached based on the headers that are forwarded.
forwardedQueryStringsoptionalIResolvable | CfnDistribution.forwarded_query_stringsoptionaltyping.Union[IResolvable, QueryStringObjectProperty]forwardedQueryStringsoptionalIResolvableForwardedQueryStringsoptionalIResolvableForwardedQueryStringsoptionalinterface{} #Your content is cached based on the query strings that are forwarded.
maximumTtloptionalnumbermaximum_ttloptionalint | floatmaximumTtloptionalNumberMaximumTtloptionaldoubleMaximumTtloptional*float64 #The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.
minimumTtloptionalnumberminimum_ttloptionalint | floatminimumTtloptionalNumberMinimumTtloptionaldoubleMinimumTtloptional*float64 #A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.