ReplaceKey

class aws_cdk.aws_s3.ReplaceKey(*args: Any, **kwargs)

Bases: object

ExampleMetadata

infused

Example:

bucket = s3.Bucket(self, "MyRedirectedBucket",
    website_routing_rules=[s3.RoutingRule(
        host_name="www.example.com",
        http_redirect_code="302",
        protocol=s3.RedirectProtocol.HTTPS,
        replace_key=s3.ReplaceKey.prefix_with("test/"),
        condition=s3.RoutingRuleCondition(
            http_error_code_returned_equals="200",
            key_prefix_equals="prefix"
        )
    )]
)

Attributes

prefix_with_key
Return type

Optional[str]

with_key
Return type

Optional[str]

Static Methods

classmethod prefix_with(key_replacement)

The object key prefix to use in the redirect request.

Parameters

key_replacement (str) –

Return type

ReplaceKey

classmethod with_(key_replacement)

The specific object key to use in the redirect request.

Parameters

key_replacement (str) –

Return type

ReplaceKey