Class Behavior.Builder

java.lang.Object
software.amazon.awscdk.services.cloudfront.Behavior.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Behavior>
Enclosing interface:
Behavior

@Stability(Stable) public static final class Behavior.Builder extends Object implements software.amazon.jsii.Builder<Behavior>
A builder for Behavior
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • allowedMethods

      @Stability(Stable) public Behavior.Builder allowedMethods(CloudFrontAllowedMethods allowedMethods)
      Parameters:
      allowedMethods - The method this CloudFront distribution responds do.
      Returns:
      this
    • cachedMethods

      @Stability(Stable) public Behavior.Builder cachedMethods(CloudFrontAllowedCachedMethods cachedMethods)
      Sets the value of Behavior.getCachedMethods()
      Parameters:
      cachedMethods - Which methods are cached by CloudFront by default.
      Returns:
      this
    • compress

      @Stability(Stable) public Behavior.Builder compress(Boolean compress)
      Sets the value of Behavior.getCompress()
      Parameters:
      compress - If CloudFront should automatically compress some content types.
      Returns:
      this
    • defaultTtl

      @Stability(Stable) public Behavior.Builder defaultTtl(Duration defaultTtl)
      Sets the value of Behavior.getDefaultTtl()
      Parameters:
      defaultTtl - The default amount of time CloudFront will cache an object. 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.
      Returns:
      this
    • forwardedValues

      @Stability(Stable) public Behavior.Builder forwardedValues(CfnDistribution.ForwardedValuesProperty forwardedValues)
      Parameters:
      forwardedValues - The values CloudFront will forward to the origin when making a request.
      Returns:
      this
    • functionAssociations

      @Stability(Stable) public Behavior.Builder functionAssociations(List<? extends FunctionAssociation> functionAssociations)
      Parameters:
      functionAssociations - The CloudFront functions to invoke before serving the contents.
      Returns:
      this
    • isDefaultBehavior

      @Stability(Stable) public Behavior.Builder isDefaultBehavior(Boolean isDefaultBehavior)
      Parameters:
      isDefaultBehavior - If this behavior is the default behavior for the distribution. You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the "path" property.
      Returns:
      this
    • lambdaFunctionAssociations

      @Stability(Stable) public Behavior.Builder lambdaFunctionAssociations(List<? extends LambdaFunctionAssociation> lambdaFunctionAssociations)
      Parameters:
      lambdaFunctionAssociations - Declares associated lambda@edge functions for this distribution behaviour.
      Returns:
      this
    • maxTtl

      @Stability(Stable) public Behavior.Builder maxTtl(Duration maxTtl)
      Sets the value of Behavior.getMaxTtl()
      Parameters:
      maxTtl - The max amount of time you want objects to stay in the cache before CloudFront queries your origin.
      Returns:
      this
    • minTtl

      @Stability(Stable) public Behavior.Builder minTtl(Duration minTtl)
      Sets the value of Behavior.getMinTtl()
      Parameters:
      minTtl - The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.
      Returns:
      this
    • pathPattern

      @Stability(Stable) public Behavior.Builder pathPattern(String pathPattern)
      Sets the value of Behavior.getPathPattern()
      Parameters:
      pathPattern - The path this behavior responds to. Required for all non-default behaviors. (The default behavior implicitly has "*" as the path pattern. )
      Returns:
      this
    • trustedKeyGroups

      @Stability(Stable) public Behavior.Builder trustedKeyGroups(List<? extends IKeyGroup> trustedKeyGroups)
      Parameters:
      trustedKeyGroups - A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
      Returns:
      this
    • trustedSigners

      @Stability(Deprecated) @Deprecated public Behavior.Builder trustedSigners(List<String> trustedSigners)
      Deprecated.
      - We recommend using trustedKeyGroups instead of trustedSigners.
      Parameters:
      trustedSigners - Trusted signers is how CloudFront allows you to serve private content. 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)

      Returns:
      this
    • viewerProtocolPolicy

      @Stability(Stable) public Behavior.Builder viewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy)
      Parameters:
      viewerProtocolPolicy - The viewer policy for this behavior.
      Returns:
      this
    • build

      @Stability(Stable) public Behavior build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<Behavior>
      Returns:
      a new instance of Behavior
      Throws:
      NullPointerException - if any required attribute was not provided