Class CfnTrail
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudTrail
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTrail : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnTrail
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html
CloudformationResource: AWS::CloudTrail::Trail
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudTrail;
var cfnTrail = new CfnTrail(this, "MyCfnTrail", new CfnTrailProps {
IsLogging = false,
S3BucketName = "s3BucketName",
// the properties below are optional
AdvancedEventSelectors = new [] { new AdvancedEventSelectorProperty {
FieldSelectors = new [] { new AdvancedFieldSelectorProperty {
Field = "field",
// the properties below are optional
EndsWith = new [] { "endsWith" },
EqualTo = new [] { "equalTo" },
NotEndsWith = new [] { "notEndsWith" },
NotEquals = new [] { "notEquals" },
NotStartsWith = new [] { "notStartsWith" },
StartsWith = new [] { "startsWith" }
} },
// the properties below are optional
Name = "name"
} },
CloudWatchLogsLogGroupArn = "cloudWatchLogsLogGroupArn",
CloudWatchLogsRoleArn = "cloudWatchLogsRoleArn",
EnableLogFileValidation = false,
EventSelectors = new [] { new EventSelectorProperty {
DataResources = new [] { new DataResourceProperty {
Type = "type",
// the properties below are optional
Values = new [] { "values" }
} },
ExcludeManagementEventSources = new [] { "excludeManagementEventSources" },
IncludeManagementEvents = false,
ReadWriteType = "readWriteType"
} },
IncludeGlobalServiceEvents = false,
InsightSelectors = new [] { new InsightSelectorProperty {
InsightType = "insightType"
} },
IsMultiRegionTrail = false,
IsOrganizationTrail = false,
KmsKeyId = "kmsKeyId",
S3KeyPrefix = "s3KeyPrefix",
SnsTopicName = "snsTopicName",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TrailName = "trailName"
});
Synopsis
Constructors
CfnTrail(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnTrail(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnTrail(Construct, String, ICfnTrailProps) |
Properties
AdvancedEventSelectors | Specifies the settings for advanced event selectors. |
AttrArn |
|
AttrSnsTopicArn |
|
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
CloudWatchLogsLogGroupArn | 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. |
CloudWatchLogsRoleArn | Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. |
EnableLogFileValidation | Specifies whether log file validation is enabled. |
EventSelectors | Use event selectors to further specify the management and data event settings for your trail. |
IncludeGlobalServiceEvents | Specifies whether the trail is publishing events from global services such as IAM to the log files. |
InsightSelectors | A JSON string that contains the Insights types you want to log on a trail. |
IsLogging | Whether the CloudTrail trail is currently logging AWS API calls. |
IsMultiRegionTrail | Specifies whether the trail applies only to the current Region or to all Regions. |
IsOrganizationTrail | Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . |
KmsKeyId | Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail. |
S3BucketName | Specifies the name of the Amazon S3 bucket designated for publishing log files. |
S3KeyPrefix | Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. |
SnsTopicName | Specifies the name of the Amazon SNS topic defined for notification of log file delivery. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | A custom set of tags (key-value pairs) for this trail. |
TrailName | Specifies the name of the trail. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnTrail(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnTrail(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnTrail(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnTrail(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnTrail(Construct, String, ICfnTrailProps)
public CfnTrail(Construct scope, string id, ICfnTrailProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnTrailProps
Resource properties.
Properties
AdvancedEventSelectors
Specifies the settings for advanced event selectors.
public virtual object AdvancedEventSelectors { get; set; }
Property Value
System.Object
AttrArn
Ref
returns the ARN of the CloudTrail trail, such as arn:aws:cloudtrail:us-east-2:123456789012:trail/myCloudTrail
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
AttrSnsTopicArn
Ref
returns the ARN of the Amazon SNS topic that's associated with the CloudTrail trail, such as arn:aws:sns:us-east-2:123456789012:mySNSTopic
.
public virtual string AttrSnsTopicArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: SnsTopicArn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
CloudWatchLogsLogGroupArn
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.
public virtual string CloudWatchLogsLogGroupArn { get; set; }
Property Value
System.String
CloudWatchLogsRoleArn
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
public virtual string CloudWatchLogsRoleArn { get; set; }
Property Value
System.String
EnableLogFileValidation
Specifies whether log file validation is enabled.
public virtual object EnableLogFileValidation { get; set; }
Property Value
System.Object
Remarks
The default is false.
EventSelectors
Use event selectors to further specify the management and data event settings for your trail.
public virtual object EventSelectors { get; set; }
Property Value
System.Object
IncludeGlobalServiceEvents
Specifies whether the trail is publishing events from global services such as IAM to the log files.
public virtual object IncludeGlobalServiceEvents { get; set; }
Property Value
System.Object
InsightSelectors
A JSON string that contains the Insights types you want to log on a trail.
public virtual object InsightSelectors { get; set; }
Property Value
System.Object
IsLogging
Whether the CloudTrail trail is currently logging AWS API calls.
public virtual object IsLogging { get; set; }
Property Value
System.Object
IsMultiRegionTrail
Specifies whether the trail applies only to the current Region or to all Regions.
public virtual object IsMultiRegionTrail { get; set; }
Property Value
System.Object
IsOrganizationTrail
Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account .
public virtual object IsOrganizationTrail { get; set; }
Property Value
System.Object
KmsKeyId
Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail.
public virtual string KmsKeyId { get; set; }
Property Value
System.String
S3BucketName
Specifies the name of the Amazon S3 bucket designated for publishing log files.
public virtual string S3BucketName { get; set; }
Property Value
System.String
S3KeyPrefix
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery.
public virtual string S3KeyPrefix { get; set; }
Property Value
System.String
SnsTopicName
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
public virtual string SnsTopicName { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
A custom set of tags (key-value pairs) for this trail.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
TrailName
Specifies the name of the trail.
public virtual string TrailName { get; set; }
Property Value
System.String
Remarks
The name must meet the following requirements:.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>