aws-cdk-lib.aws_s3.ReplaceKey

class ReplaceKey

LanguageType name
.NETAmazon.CDK.AWS.S3.ReplaceKey
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#ReplaceKey
Javasoftware.amazon.awscdk.services.s3.ReplaceKey
Pythonaws_cdk.aws_s3.ReplaceKey
TypeScript (source)aws-cdk-lib » 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

NameTypeDescription
prefixWithKey?string
withKey?string

prefixWithKey?

Type: string (optional)


withKey?

Type: string (optional)

Methods

NameDescription
static prefixWith(keyReplacement)The object key prefix to use in the redirect request.
static with(keyReplacement)The specific object key to use in the redirect request.

static prefixWith(keyReplacement)

public static prefixWith(keyReplacement: string): ReplaceKey

Parameters

  • keyReplacement string

Returns

  • ReplaceKey

The object key prefix to use in the redirect request.


static with(keyReplacement)

public static with(keyReplacement: string): ReplaceKey

Parameters

  • keyReplacement string

Returns

  • ReplaceKey

The specific object key to use in the redirect request.