interface RoutingRuleCondition
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.S3.RoutingRuleCondition |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awss3#RoutingRuleCondition |
![]() | software.amazon.awscdk.services.s3.RoutingRuleCondition |
![]() | aws_cdk.aws_s3.RoutingRuleCondition |
![]() | aws-cdk-lib » aws_s3 » RoutingRuleCondition |
Example
const bucket = new s3.Bucket(this, 'MyRedirectedBucket', {
websiteRoutingRules: [
{
hostName: 'www.example.com',
httpRedirectCode: '302',
protocol: s3.RedirectProtocol.HTTPS,
replaceKey: s3.ReplaceKey.prefixWith('test/'),
condition: {
httpErrorCodeReturnedEquals: '200',
keyPrefixEquals: 'prefix',
},
},
],
});
Properties
Name | Type | Description |
---|---|---|
http | string | The HTTP error code when the redirect is applied. |
key | string | The object key name prefix when the redirect is applied. |
httpErrorCodeReturnedEquals?
Type:
string
(optional, default: The HTTP error code will not be verified)
The HTTP error code when the redirect is applied.
In the event of an error, if the error code equals this value, then the specified redirect is applied.
If both condition properties are specified, both must be true for the redirect to be applied.
keyPrefixEquals?
Type:
string
(optional, default: The object key name will not be verified)
The object key name prefix when the redirect is applied.
If both condition properties are specified, both must be true for the redirect to be applied.