class ReplaceKey
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.S3.ReplaceKey |
Java | software.amazon.awscdk.services.s3.ReplaceKey |
Python | aws_cdk.aws_s3.ReplaceKey |
TypeScript (source) | @aws-cdk/aws-s3 » ReplaceKey |
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 |
---|---|---|
prefix | string | |
with | string |
prefixWithKey?
Type:
string
(optional)
withKey?
Type:
string
(optional)
Methods
Name | Description |
---|---|
static prefix | The object key prefix to use in the redirect request. |
static with(keyReplacement) | The specific object key to use in the redirect request. |
With(keyReplacement)
static prefixpublic static prefixWith(keyReplacement: string): ReplaceKey
Parameters
- keyReplacement
string
Returns
The object key prefix to use in the redirect request.
static with(keyReplacement)
public static with(keyReplacement: string): ReplaceKey
Parameters
- keyReplacement
string
Returns
The specific object key to use in the redirect request.