interface RoutingRule
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.S3.RoutingRule |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awss3#RoutingRule |
![]() | software.amazon.awscdk.services.s3.RoutingRule |
![]() | aws_cdk.aws_s3.RoutingRule |
![]() | aws-cdk-lib » aws_s3 » RoutingRule |
Rule that define when a redirect is applied and the redirect behavior.
See also: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
declare const replaceKey: s3.ReplaceKey;
const routingRule: s3.RoutingRule = {
condition: {
httpErrorCodeReturnedEquals: 'httpErrorCodeReturnedEquals',
keyPrefixEquals: 'keyPrefixEquals',
},
hostName: 'hostName',
httpRedirectCode: 'httpRedirectCode',
protocol: s3.RedirectProtocol.HTTP,
replaceKey: replaceKey,
};
Properties
Name | Type | Description |
---|---|---|
condition? | Routing | Specifies a condition that must be met for the specified redirect to apply. |
host | string | The host name to use in the redirect request. |
http | string | The HTTP redirect code to use on the response. |
protocol? | Redirect | Protocol to use when redirecting requests. |
replace | Replace | Specifies the object key prefix to use in the redirect request. |
condition?
Type:
Routing
(optional, default: No condition)
Specifies a condition that must be met for the specified redirect to apply.
hostName?
Type:
string
(optional, default: The host name used in the original request.)
The host name to use in the redirect request.
httpRedirectCode?
Type:
string
(optional, default: "301" - Moved Permanently)
The HTTP redirect code to use on the response.
protocol?
Type:
Redirect
(optional, default: The protocol used in the original request.)
Protocol to use when redirecting requests.
replaceKey?
Type:
Replace
(optional, default: The key will not be replaced)
Specifies the object key prefix to use in the redirect request.