@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-31T18:36:56.841Z")
public interface Behavior
Example:
// 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.*; import software.amazon.awscdk.services.lambda.*; import software.amazon.awscdk.core.*; Function function_; KeyGroup keyGroup; Version version; Behavior behavior = Behavior.builder() .allowedMethods(CloudFrontAllowedMethods.GET_HEAD) .cachedMethods(CloudFrontAllowedCachedMethods.GET_HEAD) .compress(false) .defaultTtl(Duration.minutes(30)) .forwardedValues(ForwardedValuesProperty.builder() .queryString(false) // the properties below are optional .cookies(CookiesProperty.builder() .forward("forward") // the properties below are optional .whitelistedNames(List.of("whitelistedNames")) .build()) .headers(List.of("headers")) .queryStringCacheKeys(List.of("queryStringCacheKeys")) .build()) .functionAssociations(List.of(FunctionAssociation.builder() .eventType(FunctionEventType.VIEWER_REQUEST) .function(function_) .build())) .isDefaultBehavior(false) .lambdaFunctionAssociations(List.of(LambdaFunctionAssociation.builder() .eventType(LambdaEdgeEventType.ORIGIN_REQUEST) .lambdaFunction(version) // the properties below are optional .includeBody(false) .build())) .maxTtl(Duration.minutes(30)) .minTtl(Duration.minutes(30)) .pathPattern("pathPattern") .trustedKeyGroups(List.of(keyGroup)) .trustedSigners(List.of("trustedSigners")) .viewerProtocolPolicy(ViewerProtocolPolicy.HTTPS_ONLY) .build();
Modifier and Type | Interface and Description |
---|---|
static class |
Behavior.Builder
A builder for
Behavior |
static class |
Behavior.Jsii$Proxy
An implementation for
Behavior |
Modifier and Type | Method and Description |
---|---|
static Behavior.Builder |
builder() |
default CloudFrontAllowedMethods |
getAllowedMethods()
The method this CloudFront distribution responds do.
|
default CloudFrontAllowedCachedMethods |
getCachedMethods()
Which methods are cached by CloudFront by default.
|
default java.lang.Boolean |
getCompress()
If CloudFront should automatically compress some content types.
|
default Duration |
getDefaultTtl()
The default amount of time CloudFront will cache an object.
|
default CfnDistribution.ForwardedValuesProperty |
getForwardedValues()
The values CloudFront will forward to the origin when making a request.
|
default java.util.List<FunctionAssociation> |
getFunctionAssociations()
The CloudFront functions to invoke before serving the contents.
|
default java.lang.Boolean |
getIsDefaultBehavior()
If this behavior is the default behavior for the distribution.
|
default java.util.List<LambdaFunctionAssociation> |
getLambdaFunctionAssociations()
Declares associated lambda@edge functions for this distribution behaviour.
|
default Duration |
getMaxTtl()
The max amount of time you want objects to stay in the cache before CloudFront queries your origin.
|
default Duration |
getMinTtl()
The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.
|
default java.lang.String |
getPathPattern()
The path this behavior responds to.
|
default java.util.List<IKeyGroup> |
getTrustedKeyGroups()
A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
|
default java.util.List<java.lang.String> |
getTrustedSigners()
Deprecated.
- We recommend using trustedKeyGroups instead of trustedSigners.
|
default ViewerProtocolPolicy |
getViewerProtocolPolicy()
The viewer policy for this behavior.
|
default CloudFrontAllowedMethods getAllowedMethods()
Default: GET_HEAD
default CloudFrontAllowedCachedMethods getCachedMethods()
Default: GET_HEAD
default java.lang.Boolean getCompress()
Default: true
default Duration getDefaultTtl()
This value applies only when your custom origin does not add HTTP headers, such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.
Default: 86400 (1 day)
default CfnDistribution.ForwardedValuesProperty getForwardedValues()
Default: none (no cookies - no headers)
default java.util.List<FunctionAssociation> getFunctionAssociations()
Default: - no functions will be invoked
default java.lang.Boolean getIsDefaultBehavior()
You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the "path" property.
default java.util.List<LambdaFunctionAssociation> getLambdaFunctionAssociations()
Default: No lambda function associated
default Duration getMaxTtl()
Default: Duration.seconds(31536000) (one year)
default Duration getMinTtl()
default java.lang.String getPathPattern()
Required for all non-default behaviors. (The default behavior implicitly has "*" as the path pattern. )
default java.util.List<IKeyGroup> getTrustedKeyGroups()
Default: - no KeyGroups are associated with cache behavior
@Deprecated default java.util.List<java.lang.String> getTrustedSigners()
The signers are the account IDs that are allowed to sign cookies/presigned URLs for this distribution.
If you pass a non empty value, all requests for this behavior must be signed (no public access will be allowed)
default ViewerProtocolPolicy getViewerProtocolPolicy()
Default: - the distribution wide viewer protocol policy will be used
static Behavior.Builder builder()
Behavior.Builder
of Behavior