Interface CfnBucket.RedirectRuleProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnBucket.RedirectRuleProperty.Jsii$Proxy
Enclosing class:
CfnBucket

@Stability(Stable) public static interface CfnBucket.RedirectRuleProperty extends software.amazon.jsii.JsiiSerializable
Specifies how requests are redirected.

In the event of an error, you can specify a different error code to return.

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.s3.*;
 RedirectRuleProperty redirectRuleProperty = RedirectRuleProperty.builder()
         .hostName("hostName")
         .httpRedirectCode("httpRedirectCode")
         .protocol("protocol")
         .replaceKeyPrefixWith("replaceKeyPrefixWith")
         .replaceKeyWith("replaceKeyWith")
         .build();
 
  • Method Details

    • getHostName

      @Stability(Stable) @Nullable default String getHostName()
      The host name to use in the redirect request.
    • getHttpRedirectCode

      @Stability(Stable) @Nullable default String getHttpRedirectCode()
      The HTTP redirect code to use on the response.

      Not required if one of the siblings is present.

    • getProtocol

      @Stability(Stable) @Nullable default String getProtocol()
      Protocol to use when redirecting requests.

      The default is the protocol that is used in the original request.

    • getReplaceKeyPrefixWith

      @Stability(Stable) @Nullable default String getReplaceKeyPrefixWith()
      The object key prefix to use in the redirect request.

      For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/ , you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .

    • getReplaceKeyWith

      @Stability(Stable) @Nullable default String getReplaceKeyWith()
      The specific object key to use in the redirect request.

      For example, redirect request to error.html . Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .

    • builder

      @Stability(Stable) static CfnBucket.RedirectRuleProperty.Builder builder()
      Returns:
      a CfnBucket.RedirectRuleProperty.Builder of CfnBucket.RedirectRuleProperty