RedirectRuleProperty Struct
Specifies how requests are redirected.
In the event of an error, you can specify a different error code to return.
| Source | |
|---|---|
| Type last changed |
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';
const redirectRuleProperty: s3.CfnBucket.RedirectRuleProperty = {
hostName: 'hostName',
httpRedirectCode: 'httpRedirectCode',
protocol: 'protocol',
replaceKeyPrefixWith: 'replaceKeyPrefixWith',
replaceKeyWith: 'replaceKeyWith',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_s3 as s3
redirect_rule_property = s3.CfnBucket.RedirectRuleProperty(
host_name="hostName",
http_redirect_code="httpRedirectCode",
protocol="protocol",
replace_key_prefix_with="replaceKeyPrefixWith",
replace_key_with="replaceKeyWith"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.s3.*;
RedirectRuleProperty redirectRuleProperty = RedirectRuleProperty.builder()
.hostName("hostName")
.httpRedirectCode("httpRedirectCode")
.protocol("protocol")
.replaceKeyPrefixWith("replaceKeyPrefixWith")
.replaceKeyWith("replaceKeyWith")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// 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 redirectRuleProperty = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
redirectRuleProperty := &RedirectRuleProperty{
HostName: jsii.String("hostName"),
HttpRedirectCode: jsii.String("httpRedirectCode"),
Protocol: jsii.String("protocol"),
ReplaceKeyPrefixWith: jsii.String("replaceKeyPrefixWith"),
ReplaceKeyWith: jsii.String("replaceKeyWith"),
}
Properties
hostNameoptionalstringhost_nameoptionalstrhostNameoptionalStringHostNameoptionalstringHostNameoptional*string #httpRedirectCodeoptionalstringhttp_redirect_codeoptionalstrhttpRedirectCodeoptionalStringHttpRedirectCodeoptionalstringHttpRedirectCodeoptional*string #Not required if one of the siblings is present.
protocoloptionalstringprotocoloptionalstrprotocoloptionalStringProtocoloptionalstringProtocoloptional*string #The default is the protocol that is used in the original request.
replaceKeyPrefixWithoptionalstringreplace_key_prefix_withoptionalstrreplaceKeyPrefixWithoptionalStringReplaceKeyPrefixWithoptionalstringReplaceKeyPrefixWithoptional*string #notes
For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/ , you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
replaceKeyWithoptionalstringreplace_key_withoptionalstrreplaceKeyWithoptionalStringReplaceKeyWithoptionalstringReplaceKeyWithoptional*string #notes
For example, redirect request to error.html . Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .