Class RoutingRule
Rule that define when a redirect is applied and the redirect behavior.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class RoutingRule : Object, IRoutingRule
Syntax (vb)
Public Class RoutingRule
Inherits Object
Implements IRoutingRule
Remarks
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
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;
ReplaceKey replaceKey;
var routingRule = new RoutingRule {
Condition = new RoutingRuleCondition {
HttpErrorCodeReturnedEquals = "httpErrorCodeReturnedEquals",
KeyPrefixEquals = "keyPrefixEquals"
},
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = RedirectProtocol.HTTP,
ReplaceKey = replaceKey
};
Synopsis
Constructors
RoutingRule() |
Properties
Condition | Specifies a condition that must be met for the specified redirect to apply. |
HostName | The host name to use in the redirect request. |
HttpRedirectCode | The HTTP redirect code to use on the response. |
Protocol | Protocol to use when redirecting requests. |
ReplaceKey | Specifies the object key prefix to use in the redirect request. |
Constructors
RoutingRule()
public RoutingRule()
Properties
Condition
Specifies a condition that must be met for the specified redirect to apply.
public IRoutingRuleCondition Condition { get; set; }
Property Value
Remarks
Default: - No condition
HostName
The host name to use in the redirect request.
public string HostName { get; set; }
Property Value
System.String
Remarks
Default: - The host name used in the original request.
HttpRedirectCode
The HTTP redirect code to use on the response.
public string HttpRedirectCode { get; set; }
Property Value
System.String
Remarks
Default: "301" - Moved Permanently
Protocol
Protocol to use when redirecting requests.
public Nullable<RedirectProtocol> Protocol { get; set; }
Property Value
System.Nullable<RedirectProtocol>
Remarks
Default: - The protocol used in the original request.
ReplaceKey
Specifies the object key prefix to use in the redirect request.
public ReplaceKey ReplaceKey { get; set; }
Property Value
Remarks
Default: - The key will not be replaced