AWS CloudFormation
User Guide (Version )

AWS::S3::Bucket RedirectRule

Specifies how requests are redirected. In the event of an error, you can specify a different error code to return.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "HostName" : String, "HttpRedirectCode" : String, "Protocol" : String, "ReplaceKeyPrefixWith" : String, "ReplaceKeyWith" : String }

YAML

HostName: String HttpRedirectCode: String Protocol: String ReplaceKeyPrefixWith: String ReplaceKeyWith: String

Properties

HostName

The host name to use in the redirect request.

Required: No

Type: String

Update requires: No interruption

HttpRedirectCode

The HTTP redirect code to use on the response. Not required if one of the siblings is present.

Required: No

Type: String

Update requires: No interruption

Protocol

Protocol to use when redirecting requests. The default is the protocol that is used in the original request.

Required: No

Type: String

Allowed Values: http | https

Update requires: No interruption

ReplaceKeyPrefixWith

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.

Required: No

Type: String

Update requires: No interruption

ReplaceKeyWith

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.

Required: No

Type: String

Update requires: No interruption

On this page: