import * as core from "@terrascript/core"; export interface FieldSelectorArgs extends core.SchemaArgs { endsWith?: core.Array | core.ArrayOut; equals?: core.Array | core.ArrayOut; field: string | core.StringOut; notEndsWith?: core.Array | core.ArrayOut; notEquals?: core.Array | core.ArrayOut; notStartsWith?: core.Array | core.ArrayOut; startsWith?: core.Array | core.ArrayOut; } export class FieldSelector extends core.Schema { @core.attr(String, { kind: "array" }) public endsWith?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public equals?: core.Array | core.ArrayOut; @core.attr(String) public field!: string | core.StringOut; @core.attr(String, { kind: "array" }) public notEndsWith?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public notEquals?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public notStartsWith?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public startsWith?: core.Array | core.ArrayOut; } export interface AdvancedEventSelectorArgs extends core.SchemaArgs { fieldSelector: core.Array | core.ArrayOut; name?: string | core.StringOut; } export class AdvancedEventSelector extends core.Schema { @core.attr(FieldSelector, { kind: "array" }) public fieldSelector!: | core.Array | core.ArrayOut; @core.attr(String) public name?: string | core.StringOut; } export interface InsightSelectorArgs extends core.SchemaArgs { insightType: string | core.StringOut; } export class InsightSelector extends core.Schema { @core.attr(String) public insightType!: string | core.StringOut; } export interface DataResourceArgs extends core.SchemaArgs { type: string | core.StringOut; values: core.Array | core.ArrayOut; } export class DataResource extends core.Schema { @core.attr(String) public type!: string | core.StringOut; @core.attr(String, { kind: "array" }) public values!: core.Array | core.ArrayOut; } export interface EventSelectorArgs extends core.SchemaArgs { dataResource?: core.Array | core.ArrayOut; excludeManagementEventSources?: | core.Array | core.ArrayOut; includeManagementEvents?: boolean | core.BooleanOut; readWriteType?: string | core.StringOut; } export class EventSelector extends core.Schema { @core.attr(DataResource, { kind: "array" }) public dataResource?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public excludeManagementEventSources?: | core.Array | core.ArrayOut; @core.attr(Boolean) public includeManagementEvents?: boolean | core.BooleanOut; @core.attr(String) public readWriteType?: string | core.StringOut; } export interface MainArgs extends core.ResourceArgs { /** * (Optional) Specifies an advanced event selector for enabling data event logging. Fields documented b * elow. Conflicts with `event_selector`. */ advancedEventSelector?: | core.Array | core.ArrayOut; /** * (Optional) Log group name using an ARN that represents the log group to which CloudTrail logs will b * e delivered. Note that CloudTrail requires the Log Stream wildcard. */ cloudWatchLogsGroupArn?: string | core.StringOut; /** * (Optional) Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. */ cloudWatchLogsRoleArn?: string | core.StringOut; /** * (Optional) Whether log file integrity validation is enabled. Defaults to `false`. */ enableLogFileValidation?: boolean | core.BooleanOut; /** * (Optional) Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause log * ging. */ enableLogging?: boolean | core.BooleanOut; /** * (Optional) Specifies an event selector for enabling data event logging. Fields documented below. Ple * ase note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCl * oudTrail-Limits.html) when configuring these. Conflicts with `advanced_event_selector`. */ eventSelector?: core.Array | core.ArrayOut; /** * (Optional) Whether the trail is publishing events from global services such as IAM to the log files. * Defaults to `true`. */ includeGlobalServiceEvents?: boolean | core.BooleanOut; /** * (Optional) Configuration block for identifying unusual operational activity. See details below. */ insightSelector?: | core.Array | core.ArrayOut; /** * (Optional) Whether the trail is created in the current region or in all regions. Defaults to `false` * . */ isMultiRegionTrail?: boolean | core.BooleanOut; /** * (Optional) Whether the trail is an AWS Organizations trail. Organization trails log events for the m * aster account and all member accounts. Can only be created in the organization master account. Defau * lts to `false`. */ isOrganizationTrail?: boolean | core.BooleanOut; /** * (Optional) KMS key ARN to use to encrypt the logs delivered by CloudTrail. */ kmsKeyId?: string | core.StringOut; /** * (Required) Name of the trail. */ name: string | core.StringOut; /** * (Required) Name of the S3 bucket designated for publishing log files. */ s3BucketName: string | core.StringOut; /** * (Optional) S3 key prefix that follows the name of the bucket you have designated for log file delive * ry. */ s3KeyPrefix?: string | core.StringOut; /** * (Optional) Name of the Amazon SNS topic defined for notification of log file delivery. */ snsTopicName?: string | core.StringOut; /** * (Optional) Map of tags to assign to the trail. If configured with a provider [`default_tags` configu * ration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configu * ration-block) present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: core.Map | core.MapOut; /** * Map of tags assigned to the resource, including those inherited from the provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block). */ tagsAll?: core.Map | core.MapOut; } export class Main extends core.Resource { /** * (Optional) Specifies an advanced event selector for enabling data event logging. Fields documented b * elow. Conflicts with `event_selector`. */ @core.attr(AdvancedEventSelector, { kind: "array" }) public advancedEventSelector?: | core.Array | core.ArrayOut; /** * ARN of the trail. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Optional) Log group name using an ARN that represents the log group to which CloudTrail logs will b * e delivered. Note that CloudTrail requires the Log Stream wildcard. */ @core.attr(String) public cloudWatchLogsGroupArn?: string | core.StringOut; /** * (Optional) Role for the CloudWatch Logs endpoint to assume to write to a user’s log group. */ @core.attr(String) public cloudWatchLogsRoleArn?: string | core.StringOut; /** * (Optional) Whether log file integrity validation is enabled. Defaults to `false`. */ @core.attr(Boolean) public enableLogFileValidation?: boolean | core.BooleanOut; /** * (Optional) Enables logging for the trail. Defaults to `true`. Setting this to `false` will pause log * ging. */ @core.attr(Boolean) public enableLogging?: boolean | core.BooleanOut; /** * (Optional) Specifies an event selector for enabling data event logging. Fields documented below. Ple * ase note the [CloudTrail limits](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCl * oudTrail-Limits.html) when configuring these. Conflicts with `advanced_event_selector`. */ @core.attr(EventSelector, { kind: "array" }) public eventSelector?: | core.Array | core.ArrayOut; /** * Region in which the trail was created. */ @core.attr(String, { computed: true }) public homeRegion!: string | core.StringOut; /** * Name of the trail. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Optional) Whether the trail is publishing events from global services such as IAM to the log files. * Defaults to `true`. */ @core.attr(Boolean) public includeGlobalServiceEvents?: boolean | core.BooleanOut; /** * (Optional) Configuration block for identifying unusual operational activity. See details below. */ @core.attr(InsightSelector, { kind: "array" }) public insightSelector?: | core.Array | core.ArrayOut; /** * (Optional) Whether the trail is created in the current region or in all regions. Defaults to `false` * . */ @core.attr(Boolean) public isMultiRegionTrail?: boolean | core.BooleanOut; /** * (Optional) Whether the trail is an AWS Organizations trail. Organization trails log events for the m * aster account and all member accounts. Can only be created in the organization master account. Defau * lts to `false`. */ @core.attr(Boolean) public isOrganizationTrail?: boolean | core.BooleanOut; /** * (Optional) KMS key ARN to use to encrypt the logs delivered by CloudTrail. */ @core.attr(String) public kmsKeyId?: string | core.StringOut; /** * (Required) Name of the trail. */ @core.attr(String) public name!: string | core.StringOut; /** * (Required) Name of the S3 bucket designated for publishing log files. */ @core.attr(String) public s3BucketName!: string | core.StringOut; /** * (Optional) S3 key prefix that follows the name of the bucket you have designated for log file delive * ry. */ @core.attr(String) public s3KeyPrefix?: string | core.StringOut; /** * (Optional) Name of the Amazon SNS topic defined for notification of log file delivery. */ @core.attr(String) public snsTopicName?: string | core.StringOut; /** * (Optional) Map of tags to assign to the trail. If configured with a provider [`default_tags` configu * ration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configu * ration-block) present, tags with matching keys will overwrite those defined at the provider-level. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * Map of tags assigned to the resource, including those inherited from the provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; constructor(name: string, args?: MainArgs) { super(name, "aws_cloudtrail", args); } public override getNamespace(): string { return "aws_cloudtrail"; } }