CacheTagConfigProperty Struct
A complex type that specifies the HTTP header name from which CloudFront extracts cache tags from origin responses.
When you add CacheTagConfig to a distribution, CloudFront reads the specified header from origin responses, parses the comma-separated tag values, and stores them with the cached object. You can then invalidate cached objects by tag using the CreateInvalidation API.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const cacheTagConfigProperty: cloudfront.CfnDistribution.CacheTagConfigProperty = {
headerName: 'headerName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront
cache_tag_config_property = cloudfront.CfnDistribution.CacheTagConfigProperty(
header_name="headerName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
CacheTagConfigProperty cacheTagConfigProperty = CacheTagConfigProperty.builder()
.headerName("headerName")
.build();
csharp
// 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.CloudFront;
var cacheTagConfigProperty = new CacheTagConfigProperty {
HeaderName = "headerName"
};
go
// 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"
cacheTagConfigProperty := &CacheTagConfigProperty{
HeaderName: jsii.String("headerName"),
}
Properties
The name of the HTTP header that your origin includes in responses.
CloudFront uses this header to extract cache tags. The header value must contain comma-separated tag values (for example, product:electronics, category:tv, brand:example).