Show / Hide Table of Contents

Class TargetObjectKeyFormat

The key format for the log object.

Inheritance
object
TargetObjectKeyFormat
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class TargetObjectKeyFormat : DeputyBase
Syntax (vb)
Public MustInherit Class TargetObjectKeyFormat Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
var accessLogsBucket = new Bucket(this, "AccessLogsBucket");

            var bucket = new Bucket(this, "MyBucket", new BucketProps {
                ServerAccessLogsBucket = accessLogsBucket,
                ServerAccessLogsPrefix = "logs",
                // You can use a simple prefix with `TargetObjectKeyFormat.simplePrefix()`, but it is the same even if you do not specify `targetObjectKeyFormat` property.
                TargetObjectKeyFormat = TargetObjectKeyFormat.SimplePrefix()
            });

Synopsis

Constructors

TargetObjectKeyFormat()

The key format for the log object.

Methods

PartitionedPrefix(PartitionDateSource?)

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

SimplePrefix()

Use the simple prefix for log objects.

Constructors

TargetObjectKeyFormat()

The key format for the log object.

protected TargetObjectKeyFormat()
Remarks

ExampleMetadata: infused

Examples
var accessLogsBucket = new Bucket(this, "AccessLogsBucket");

            var bucket = new Bucket(this, "MyBucket", new BucketProps {
                ServerAccessLogsBucket = accessLogsBucket,
                ServerAccessLogsPrefix = "logs",
                // You can use a simple prefix with `TargetObjectKeyFormat.simplePrefix()`, but it is the same even if you do not specify `targetObjectKeyFormat` property.
                TargetObjectKeyFormat = TargetObjectKeyFormat.SimplePrefix()
            });

Methods

PartitionedPrefix(PartitionDateSource?)

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

public static TargetObjectKeyFormat PartitionedPrefix(PartitionDateSource? dateSource = null)
Parameters
dateSource PartitionDateSource?
Returns

TargetObjectKeyFormat

Remarks

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

SimplePrefix()

Use the simple prefix for log objects.

public static TargetObjectKeyFormat SimplePrefix()
Returns

TargetObjectKeyFormat

Remarks

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

Back to top Generated by DocFX