Interface CfnBucket.IRoutingRuleProperty
Specifies the redirect behavior and when a redirect is applied.
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRoutingRuleProperty
Syntax (vb)
Public Interface IRoutingRuleProperty
Remarks
For more information about routing rules, see Configuring advanced conditional redirects in the Amazon S3 User Guide .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;
var routingRuleProperty = new RoutingRuleProperty {
RedirectRule = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
},
// the properties below are optional
RoutingRuleCondition = new RoutingRuleConditionProperty {
HttpErrorCodeReturnedEquals = "httpErrorCodeReturnedEquals",
KeyPrefixEquals = "keyPrefixEquals"
}
};
Synopsis
Properties
RedirectRule | Container for redirect information. |
RoutingRuleCondition | A container for describing a condition that must be met for the specified redirect to apply. |
Properties
RedirectRule
Container for redirect information.
object RedirectRule { get; }
Property Value
System.Object
Remarks
You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.
RoutingRuleCondition
A container for describing a condition that must be met for the specified redirect to apply.
virtual object RoutingRuleCondition { get; }
Property Value
System.Object
Remarks
For example, 1. If request is for pages in the /docs
folder, redirect to the /documents
folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.