Class CfnTrail
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.cloudtrail.CfnTrail
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-12-27T17:01:58.598Z")
@Stability(Stable)
public class CfnTrail
extends CfnResource
implements IInspectable, ITaggable
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.cloudtrail.*; CfnTrail cfnTrail = CfnTrail.Builder.create(this, "MyCfnTrail") .isLogging(false) .s3BucketName("s3BucketName") // the properties below are optional .advancedEventSelectors(List.of(AdvancedEventSelectorProperty.builder() .fieldSelectors(List.of(AdvancedFieldSelectorProperty.builder() .field("field") // the properties below are optional .endsWith(List.of("endsWith")) .equalTo(List.of("equalTo")) .notEndsWith(List.of("notEndsWith")) .notEquals(List.of("notEquals")) .notStartsWith(List.of("notStartsWith")) .startsWith(List.of("startsWith")) .build())) // the properties below are optional .name("name") .build())) .cloudWatchLogsLogGroupArn("cloudWatchLogsLogGroupArn") .cloudWatchLogsRoleArn("cloudWatchLogsRoleArn") .enableLogFileValidation(false) .eventSelectors(List.of(EventSelectorProperty.builder() .dataResources(List.of(DataResourceProperty.builder() .type("type") // the properties below are optional .values(List.of("values")) .build())) .excludeManagementEventSources(List.of("excludeManagementEventSources")) .includeManagementEvents(false) .readWriteType("readWriteType") .build())) .includeGlobalServiceEvents(false) .insightSelectors(List.of(InsightSelectorProperty.builder() .insightType("insightType") .build())) .isMultiRegionTrail(false) .isOrganizationTrail(false) .kmsKeyId("kmsKeyId") .s3KeyPrefix("s3KeyPrefix") .snsTopicName("snsTopicName") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .trailName("trailName") .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Advanced event selectors let you create fine-grained selectors for AWS CloudTrail management, data, and network activity events.static interface
A single selector statement in an advanced event selector.static final class
A fluent builder forCfnTrail
.static interface
You can configure theDataResource
in anEventSelector
to log data events for the following three resource types:.static interface
Use event selectors to further specify the management and data event settings for your trail.static interface
A JSON string that contains a list of Insights types that are logged on a trail.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnTrail
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnTrail
(software.amazon.jsii.JsiiObjectRef objRef) CfnTrail
(software.constructs.Construct scope, String id, CfnTrailProps props) -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the settings for advanced event selectors.Ref
returns the ARN of the CloudTrail trail, such asarn:aws:cloudtrail:us-east-2:123456789012:trail/myCloudTrail
.Ref
returns the ARN of the Amazon SNS topic that's associated with the CloudTrail trail, such asarn:aws:sns:us-east-2:123456789012:mySNSTopic
.Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered.Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.Specifies whether log file validation is enabled.Use event selectors to further specify the management and data event settings for your trail.Specifies whether the trail is publishing events from global services such as IAM to the log files.A JSON string that contains the Insights types you want to log on a trail.Whether the CloudTrail trail is currently logging AWS API calls.Specifies whether the trail applies only to the current Region or to all Regions.Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account .Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail.Specifies the name of the Amazon S3 bucket designated for publishing log files.Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery.Specifies the name of the Amazon SNS topic defined for notification of log file delivery.getTags()
Tag Manager which manages the tags for this resource.A custom set of tags (key-value pairs) for this trail.Specifies the name of the trail.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAdvancedEventSelectors
(List<Object> value) Specifies the settings for advanced event selectors.void
Specifies the settings for advanced event selectors.void
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered.void
setCloudWatchLogsRoleArn
(String value) Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.void
Specifies whether log file validation is enabled.void
Specifies whether log file validation is enabled.void
setEventSelectors
(List<Object> value) Use event selectors to further specify the management and data event settings for your trail.void
setEventSelectors
(IResolvable value) Use event selectors to further specify the management and data event settings for your trail.void
Specifies whether the trail is publishing events from global services such as IAM to the log files.void
Specifies whether the trail is publishing events from global services such as IAM to the log files.void
setInsightSelectors
(List<Object> value) A JSON string that contains the Insights types you want to log on a trail.void
setInsightSelectors
(IResolvable value) A JSON string that contains the Insights types you want to log on a trail.void
setIsLogging
(Boolean value) Whether the CloudTrail trail is currently logging AWS API calls.void
setIsLogging
(IResolvable value) Whether the CloudTrail trail is currently logging AWS API calls.void
setIsMultiRegionTrail
(Boolean value) Specifies whether the trail applies only to the current Region or to all Regions.void
setIsMultiRegionTrail
(IResolvable value) Specifies whether the trail applies only to the current Region or to all Regions.void
setIsOrganizationTrail
(Boolean value) Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account .void
Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account .void
setKmsKeyId
(String value) Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail.void
setS3BucketName
(String value) Specifies the name of the Amazon S3 bucket designated for publishing log files.void
setS3KeyPrefix
(String value) Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery.void
setSnsTopicName
(String value) Specifies the name of the Amazon SNS topic defined for notification of log file delivery.void
setTagsRaw
(List<CfnTag> value) A custom set of tags (key-value pairs) for this trail.void
setTrailName
(String value) Specifies the name of the trail.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnTrail
protected CfnTrail(software.amazon.jsii.JsiiObjectRef objRef) -
CfnTrail
protected CfnTrail(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnTrail
@Stability(Stable) public CfnTrail(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTrailProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
Ref
returns the ARN of the CloudTrail trail, such asarn:aws:cloudtrail:us-east-2:123456789012:trail/myCloudTrail
. -
getAttrSnsTopicArn
Ref
returns the ARN of the Amazon SNS topic that's associated with the CloudTrail trail, such asarn:aws:sns:us-east-2:123456789012:mySNSTopic
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getIsLogging
Whether the CloudTrail trail is currently logging AWS API calls. -
setIsLogging
Whether the CloudTrail trail is currently logging AWS API calls. -
setIsLogging
Whether the CloudTrail trail is currently logging AWS API calls. -
getS3BucketName
Specifies the name of the Amazon S3 bucket designated for publishing log files. -
setS3BucketName
Specifies the name of the Amazon S3 bucket designated for publishing log files. -
getAdvancedEventSelectors
Specifies the settings for advanced event selectors. -
setAdvancedEventSelectors
Specifies the settings for advanced event selectors. -
setAdvancedEventSelectors
Specifies the settings for advanced event selectors. -
getCloudWatchLogsLogGroupArn
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. -
setCloudWatchLogsLogGroupArn
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. -
getCloudWatchLogsRoleArn
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. -
setCloudWatchLogsRoleArn
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. -
getEnableLogFileValidation
Specifies whether log file validation is enabled.The default is false.
-
setEnableLogFileValidation
Specifies whether log file validation is enabled.The default is false.
-
setEnableLogFileValidation
Specifies whether log file validation is enabled.The default is false.
-
getEventSelectors
Use event selectors to further specify the management and data event settings for your trail. -
setEventSelectors
Use event selectors to further specify the management and data event settings for your trail. -
setEventSelectors
Use event selectors to further specify the management and data event settings for your trail. -
getIncludeGlobalServiceEvents
Specifies whether the trail is publishing events from global services such as IAM to the log files. -
setIncludeGlobalServiceEvents
Specifies whether the trail is publishing events from global services such as IAM to the log files. -
setIncludeGlobalServiceEvents
Specifies whether the trail is publishing events from global services such as IAM to the log files. -
getInsightSelectors
A JSON string that contains the Insights types you want to log on a trail. -
setInsightSelectors
A JSON string that contains the Insights types you want to log on a trail. -
setInsightSelectors
A JSON string that contains the Insights types you want to log on a trail. -
getIsMultiRegionTrail
Specifies whether the trail applies only to the current Region or to all Regions. -
setIsMultiRegionTrail
Specifies whether the trail applies only to the current Region or to all Regions. -
setIsMultiRegionTrail
Specifies whether the trail applies only to the current Region or to all Regions. -
getIsOrganizationTrail
Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . -
setIsOrganizationTrail
Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . -
setIsOrganizationTrail
Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . -
getKmsKeyId
Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail. -
setKmsKeyId
Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail. -
getS3KeyPrefix
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. -
setS3KeyPrefix
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. -
getSnsTopicName
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. -
setSnsTopicName
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. -
getTagsRaw
A custom set of tags (key-value pairs) for this trail. -
setTagsRaw
A custom set of tags (key-value pairs) for this trail. -
getTrailName
Specifies the name of the trail.The name must meet the following requirements:.
-
setTrailName
Specifies the name of the trail.The name must meet the following requirements:.
-