Skip to content
v2.274.0

ReplaceKey Class ​

Example ​

ts
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 ​

prefixWithKeymay be undefinedstringprefix_with_keymay be undefinedstrprefixWithKeymay be undefinedStringPrefixWithKeymay be undefinedstringPrefixWithKeymay be undefined*string#
withKeymay be undefinedstringwith_keymay be undefinedstrwithKeymay be undefinedStringWithKeymay be undefinedstringWithKeymay be undefined*string#

Methods ​

prefixWith(keyReplacement: string): ReplaceKey // chainable@staticmethod def prefix_with(key_replacement: str) -> ReplaceKeypublic static ReplaceKey prefixWith(String keyReplacement)public static ReplaceKey PrefixWith(string keyReplacement)func PrefixWith(KeyReplacement *string) ReplaceKeystatic#
The object key prefix to use in the redirect request.
with(keyReplacement: string): ReplaceKey // chainable@staticmethod def with(key_replacement: str) -> ReplaceKeypublic static ReplaceKey with(String keyReplacement)public static ReplaceKey With(string keyReplacement)func With(KeyReplacement *string) ReplaceKeystatic#
The specific object key to use in the redirect request.