@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.611Z") @Stability(value=Stable) public interface Behavior extends software.amazon.jsii.JsiiSerializable
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 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 List<FunctionAssociation> |
getFunctionAssociations()
The CloudFront functions to invoke before serving the contents.
|
default Boolean |
getIsDefaultBehavior()
If this behavior is the default behavior for the distribution.
|
default 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 String |
getPathPattern()
The path this behavior responds to.
|
default List<IKeyGroup> |
getTrustedKeyGroups()
A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
|
default List<String> |
getTrustedSigners()
Deprecated.
- We recommend using trustedKeyGroups instead of trustedSigners.
|
default ViewerProtocolPolicy |
getViewerProtocolPolicy()
The viewer policy for this behavior.
|
@Stability(value=Stable) @Nullable default CloudFrontAllowedMethods getAllowedMethods()
Default: GET_HEAD
@Stability(value=Stable) @Nullable default CloudFrontAllowedCachedMethods getCachedMethods()
Default: GET_HEAD
@Stability(value=Stable) @Nullable default Boolean getCompress()
Default: true
@Stability(value=Stable) @Nullable 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)
@Stability(value=Stable) @Nullable default CfnDistribution.ForwardedValuesProperty getForwardedValues()
Default: none (no cookies - no headers)
@Stability(value=Stable) @Nullable default List<FunctionAssociation> getFunctionAssociations()
Default: - no functions will be invoked
@Stability(value=Stable) @Nullable default Boolean getIsDefaultBehavior()
You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the "path" property.
@Stability(value=Stable) @Nullable default List<LambdaFunctionAssociation> getLambdaFunctionAssociations()
Default: No lambda function associated
@Stability(value=Stable) @Nullable default Duration getMaxTtl()
Default: Duration.seconds(31536000) (one year)
@Stability(value=Stable) @Nullable default Duration getMinTtl()
@Stability(value=Stable) @Nullable default String getPathPattern()
Required for all non-default behaviors. (The default behavior implicitly has "*" as the path pattern. )
@Stability(value=Stable) @Nullable default List<IKeyGroup> getTrustedKeyGroups()
Default: - no KeyGroups are associated with cache behavior
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html@Stability(value=Deprecated) @Deprecated @Nullable default List<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)
@Stability(value=Stable) @Nullable default ViewerProtocolPolicy getViewerProtocolPolicy()
Default: - the distribution wide viewer protocol policy will be used
@Stability(value=Stable) static Behavior.Builder builder()
Behavior.Builder of BehaviorCopyright © 2022. All rights reserved.