Show / Hide Table of Contents

Class TrailProps

Properties for an AWS CloudTrail trail.

Inheritance
System.Object
TrailProps
Implements
ITrailProps
Namespace: Amazon.CDK.AWS.CloudTrail
Assembly: Amazon.CDK.AWS.CloudTrail.dll
Syntax (csharp)
public class TrailProps : Object, ITrailProps
Syntax (vb)
Public Class TrailProps
    Inherits Object
    Implements ITrailProps
Remarks

ExampleMetadata: infused

Examples
Trail trail = new Trail(this, "CloudTrail", new TrailProps {
    // ...
    ManagementEvents = ReadWriteType.READ_ONLY
});

Synopsis

Constructors

TrailProps()

Properties

Bucket

The Amazon S3 bucket.

CloudWatchLogGroup

Log Group to which CloudTrail to push logs to.

CloudWatchLogsRetention

How long to retain logs in CloudWatchLogs.

EnableFileValidation

To determine whether a log file was modified, deleted, or unchanged after CloudTrail delivered it, you can use CloudTrail log file integrity validation.

EncryptionKey

The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs.

IncludeGlobalServiceEvents

For most services, events are recorded in the region where the action occurred.

IsMultiRegionTrail

Whether or not this trail delivers log files from multiple regions to a single S3 bucket for a single account.

KmsKey

(deprecated) The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs.

ManagementEvents

When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.

S3KeyPrefix

An Amazon S3 object key prefix that precedes the name of all log files.

SendToCloudWatchLogs

If CloudTrail pushes logs to CloudWatch Logs in addition to S3.

SnsTopic

SNS topic that is notified when new log files are published.

TrailName

The name of the trail.

Constructors

TrailProps()

public TrailProps()

Properties

Bucket

The Amazon S3 bucket.

public IBucket Bucket { get; set; }
Property Value

IBucket

Remarks

Default: - if not supplied a bucket will be created with all the correct permisions

CloudWatchLogGroup

Log Group to which CloudTrail to push logs to.

public ILogGroup CloudWatchLogGroup { get; set; }
Property Value

ILogGroup

Remarks

Ignored if sendToCloudWatchLogs is set to false.

Default: - a new log group is created and used.

CloudWatchLogsRetention

How long to retain logs in CloudWatchLogs.

public Nullable<RetentionDays> CloudWatchLogsRetention { get; set; }
Property Value

System.Nullable<RetentionDays>

Remarks

Ignored if sendToCloudWatchLogs is false or if cloudWatchLogGroup is set.

Default: logs.RetentionDays.ONE_YEAR

EnableFileValidation

To determine whether a log file was modified, deleted, or unchanged after CloudTrail delivered it, you can use CloudTrail log file integrity validation.

public Nullable<bool> EnableFileValidation { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

This feature is built using industry standard algorithms: SHA-256 for hashing and SHA-256 with RSA for digital signing. This makes it computationally infeasible to modify, delete or forge CloudTrail log files without detection. You can use the AWS CLI to validate the files in the location where CloudTrail delivered them.

Default: true

EncryptionKey

The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs.

public IKey EncryptionKey { get; set; }
Property Value

IKey

Remarks

Default: - No encryption.

IncludeGlobalServiceEvents

For most services, events are recorded in the region where the action occurred.

public Nullable<bool> IncludeGlobalServiceEvents { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

For global services such as AWS Identity and Access Management (IAM), AWS STS, Amazon CloudFront, and Route 53, events are delivered to any trail that includes global services, and are logged as occurring in US East (N. Virginia) Region.

Default: true

IsMultiRegionTrail

Whether or not this trail delivers log files from multiple regions to a single S3 bucket for a single account.

public Nullable<bool> IsMultiRegionTrail { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: true

KmsKey

(deprecated) The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs.

public IKey KmsKey { get; set; }
Property Value

IKey

Remarks

Default: - No encryption.

Stability: Deprecated

ManagementEvents

When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.

public Nullable<ReadWriteType> ManagementEvents { get; set; }
Property Value

System.Nullable<ReadWriteType>

Remarks

Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.

This method sets the management configuration for this trail.

Management events provide insight into management operations that are performed on resources in your AWS account. These are also known as control plane operations. Management events can also include non-API events that occur in your account. For example, when a user logs in to your account, CloudTrail logs the ConsoleLogin event.

Default: ReadWriteType.ALL

S3KeyPrefix

An Amazon S3 object key prefix that precedes the name of all log files.

public string S3KeyPrefix { get; set; }
Property Value

System.String

Remarks

Default: - No prefix.

SendToCloudWatchLogs

If CloudTrail pushes logs to CloudWatch Logs in addition to S3.

public Nullable<bool> SendToCloudWatchLogs { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Disabled for cost out of the box.

Default: false

SnsTopic

SNS topic that is notified when new log files are published.

public ITopic SnsTopic { get; set; }
Property Value

ITopic

Remarks

Default: - No notifications.

TrailName

The name of the trail.

public string TrailName { get; set; }
Property Value

System.String

Remarks

We recommend customers do not set an explicit name.

Default: - AWS CloudFormation generated name.

Implements

ITrailProps
Back to top Generated by DocFX