Class CfnBucketPropsMixin.RoutingRuleProperty
Specifies the redirect behavior and when a redirect is applied.
Implements
Inherited Members
Namespace: Amazon.CDK.Mixins.Preview.AWS.S3.Mixins
Assembly: Amazon.CDK.Mixins.Preview.dll
Syntax (csharp)
public class CfnBucketPropsMixin.RoutingRuleProperty : CfnBucketPropsMixin.IRoutingRuleProperty
Syntax (vb)
Public Class CfnBucketPropsMixin.RoutingRuleProperty Implements CfnBucketPropsMixin.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.Mixins.Preview.AWS.S3.Mixins;
var routingRuleProperty = new RoutingRuleProperty {
RedirectRule = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
},
RoutingRuleCondition = new RoutingRuleConditionProperty {
HttpErrorCodeReturnedEquals = "httpErrorCodeReturnedEquals",
KeyPrefixEquals = "keyPrefixEquals"
}
};
Synopsis
Constructors
| RoutingRuleProperty() | Specifies the redirect behavior and when a redirect is applied. |
Properties
| RedirectRule | Container for redirect information. |
| RoutingRuleCondition | A container for describing a condition that must be met for the specified redirect to apply. |
Constructors
RoutingRuleProperty()
Specifies the redirect behavior and when a redirect is applied.
public RoutingRuleProperty()
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.Mixins.Preview.AWS.S3.Mixins;
var routingRuleProperty = new RoutingRuleProperty {
RedirectRule = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
},
RoutingRuleCondition = new RoutingRuleConditionProperty {
HttpErrorCodeReturnedEquals = "httpErrorCodeReturnedEquals",
KeyPrefixEquals = "keyPrefixEquals"
}
};
Properties
RedirectRule
Container for redirect information.
public object? RedirectRule { get; set; }
Property Value
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.
Type union: either IResolvable or CfnBucketPropsMixin.IRedirectRuleProperty
RoutingRuleCondition
A container for describing a condition that must be met for the specified redirect to apply.
public object? RoutingRuleCondition { get; set; }
Property Value
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.
Type union: either IResolvable or CfnBucketPropsMixin.IRoutingRuleConditionProperty