TargetObjectKeyFormat

class aws_cdk.aws_s3.TargetObjectKeyFormat

Bases: object

The key format for the log object.

ExampleMetadata:

infused

Example:

access_logs_bucket = s3.Bucket(self, "AccessLogsBucket")

bucket = s3.Bucket(self, "MyBucket",
    server_access_logs_bucket=access_logs_bucket,
    server_access_logs_prefix="logs",
    # You can use a simple prefix with `TargetObjectKeyFormat.simplePrefix()`, but it is the same even if you do not specify `targetObjectKeyFormat` property.
    target_object_key_format=s3.TargetObjectKeyFormat.simple_prefix()
)

Static Methods

classmethod partitioned_prefix(date_source=None)

Use partitioned prefix for log objects. If you do not specify the dateSource argument, the default is EventTime.

The partitioned prefix format as follow: [DestinationPrefix][SourceAccountId]/​[SourceRegion]/​[SourceBucket]/​[YYYY]/​[MM]/​[DD]/​[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]

Parameters:

date_source (Optional[PartitionDateSource]) –

Return type:

TargetObjectKeyFormat

classmethod simple_prefix()

Use the simple prefix for log objects.

The simple prefix format as follow: [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]

Return type:

TargetObjectKeyFormat