@Generated(value="jsii-pacmak/1.29.0 (build 41df200)", date="2021-06-02T09:55:01.249Z") @Stability(value=Experimental) public class Trail extends Resource
import { CloudTrail } from '@aws-cdk/aws-cloudtrail'
const cloudTrail = new CloudTrail(this, 'MyTrail');
NOTE the above example creates an UNENCRYPTED bucket by default, If you are required to use an Encrypted bucket you can supply a preconfigured bucket via TrailProps
| Modifier and Type | Class and Description |
|---|---|
static class |
Trail.Builder
(experimental) A fluent builder for
Trail. |
software.amazon.jsii.JsiiObject.InitializationModeIResource.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
Trail(software.constructs.Construct scope,
String id) |
|
Trail(software.constructs.Construct scope,
String id,
TrailProps props) |
protected |
Trail(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Trail(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventSelector(DataResourceType dataResourceType,
List<String> dataResourceValues)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
void |
addEventSelector(DataResourceType dataResourceType,
List<String> dataResourceValues,
AddEventSelectorOptions options)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
void |
addLambdaEventSelector(List<IFunction> handlers)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
void |
addLambdaEventSelector(List<IFunction> handlers,
AddEventSelectorOptions options)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
void |
addS3EventSelector(List<S3EventSelector> s3Selector)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
void |
addS3EventSelector(List<S3EventSelector> s3Selector,
AddEventSelectorOptions options)
(experimental) When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails.
|
ILogGroup |
getLogGroup()
(experimental) The CloudWatch log group to which CloudTrail events are sent.
|
String |
getTrailArn()
(experimental) ARN of the CloudTrail trail i.e.
|
String |
getTrailSnsTopicArn()
(experimental) ARN of the Amazon SNS topic that's associated with the CloudTrail trail, i.e.
|
void |
logAllLambdaDataEvents()
(experimental) Log all Lamda data events for all lambda functions the account.
|
void |
logAllLambdaDataEvents(AddEventSelectorOptions options)
(experimental) Log all Lamda data events for all lambda functions the account.
|
void |
logAllS3DataEvents()
(experimental) Log all S3 data events for all objects for all buckets in the account.
|
void |
logAllS3DataEvents(AddEventSelectorOptions options)
(experimental) Log all S3 data events for all objects for all buckets in the account.
|
static Rule |
onEvent(software.constructs.Construct scope,
String id)
(experimental) Create an event rule for when an event is recorded by any Trail in the account.
|
static Rule |
onEvent(software.constructs.Construct scope,
String id,
OnEventOptions options)
(experimental) Create an event rule for when an event is recorded by any Trail in the account.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Trail(software.amazon.jsii.JsiiObjectRef objRef)
protected Trail(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Trail(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
TrailProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Experimental)
public Trail(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental) @NotNull public static Rule onEvent(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable OnEventOptions options)
Note that the event doesn't necessarily have to come from this Trail, it can be captured from any one.
Be sure to filter the event further down using an event pattern.
scope - This parameter is required.id - This parameter is required.options - @Stability(value=Experimental) @NotNull public static Rule onEvent(@NotNull software.constructs.Construct scope, @NotNull String id)
Note that the event doesn't necessarily have to come from this Trail, it can be captured from any one.
Be sure to filter the event further down using an event pattern.
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental)
public void addEventSelector(@NotNull
DataResourceType dataResourceType,
@NotNull
List<String> dataResourceValues,
@Nullable
AddEventSelectorOptions options)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds an Event Selector for filtering events that match either S3 or Lambda function operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
dataResourceType - This parameter is required.dataResourceValues - the list of data resource ARNs to include in logging (maximum 250 entries). This parameter is required.options - the options to configure logging of management and data events.@Stability(value=Experimental)
public void addEventSelector(@NotNull
DataResourceType dataResourceType,
@NotNull
List<String> dataResourceValues)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds an Event Selector for filtering events that match either S3 or Lambda function operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
dataResourceType - This parameter is required.dataResourceValues - the list of data resource ARNs to include in logging (maximum 250 entries). This parameter is required.@Stability(value=Experimental)
public void addLambdaEventSelector(@NotNull
List<IFunction> handlers,
@Nullable
AddEventSelectorOptions options)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds a Lambda Data Event Selector for filtering events that match Lambda function operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
handlers - the list of lambda function handlers whose data events should be logged (maximum 250 entries). This parameter is required.options - the options to configure logging of management and data events.@Stability(value=Experimental)
public void addLambdaEventSelector(@NotNull
List<IFunction> handlers)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds a Lambda Data Event Selector for filtering events that match Lambda function operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
handlers - the list of lambda function handlers whose data events should be logged (maximum 250 entries). This parameter is required.@Stability(value=Experimental)
public void addS3EventSelector(@NotNull
List<S3EventSelector> s3Selector,
@Nullable
AddEventSelectorOptions options)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds an S3 Data Event Selector for filtering events that match S3 operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
s3Selector - the list of S3 bucket with optional prefix to include in logging (maximum 250 entries). This parameter is required.options - the options to configure logging of management and data events.@Stability(value=Experimental)
public void addS3EventSelector(@NotNull
List<S3EventSelector> s3Selector)
Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group.
This method adds an S3 Data Event Selector for filtering events that match S3 operations.
Data events: These events provide insight into the resource operations performed on or within a resource. These are also known as data plane operations.
s3Selector - the list of S3 bucket with optional prefix to include in logging (maximum 250 entries). This parameter is required.@Stability(value=Experimental)
public void logAllLambdaDataEvents(@Nullable
AddEventSelectorOptions options)
Default: false
options - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html@Stability(value=Experimental) public void logAllLambdaDataEvents()
Default: false
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html@Stability(value=Experimental)
public void logAllS3DataEvents(@Nullable
AddEventSelectorOptions options)
Default: false
options - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html@Stability(value=Experimental) public void logAllS3DataEvents()
Default: false
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html@Stability(value=Experimental) @NotNull public String getTrailArn()
@Stability(value=Experimental) @NotNull public String getTrailSnsTopicArn()
@Stability(value=Experimental) @Nullable public ILogGroup getLogGroup()
undefined if sendToCloudWatchLogs property is false.
Copyright © 2021. All rights reserved.