amazonka-cloudtrail-2.0: Amazon CloudTrail SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CloudTrail.CreateTrail

Description

Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.

Synopsis

Creating a Request

data CreateTrail Source #

Specifies the settings for each trail.

See: newCreateTrail smart constructor.

Constructors

CreateTrail' 

Fields

  • cloudWatchLogsLogGroupArn :: Maybe Text

    Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.

  • cloudWatchLogsRoleArn :: Maybe Text

    Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.

  • enableLogFileValidation :: Maybe Bool

    Specifies whether log file integrity validation is enabled. The default is false.

    When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.

  • includeGlobalServiceEvents :: Maybe Bool

    Specifies whether the trail is publishing events from global services such as IAM to the log files.

  • isMultiRegionTrail :: Maybe Bool

    Specifies whether the trail is created in the current region or in all regions. The default is false, which creates a trail only in the region where you are signed in. As a best practice, consider creating trails that log events in all regions.

  • isOrganizationTrail :: Maybe Bool

    Specifies whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations.

  • kmsKeyId :: Maybe Text

    Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by alias/, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.

    CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.

    Examples:

    • alias/MyAliasName
    • arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
    • arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
    • 12345678-1234-1234-1234-123456789012
  • s3KeyPrefix :: Maybe Text

    Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

  • snsTopicName :: Maybe Text

    Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.

  • tagsList :: Maybe [Tag]
     
  • name :: Text

    Specifies the name of the trail. The name must meet the following requirements:

    • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
    • Start with a letter or number, and end with a letter or number
    • Be between 3 and 128 characters
    • Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are not valid.
    • Not be in IP address format (for example, 192.168.5.4)
  • s3BucketName :: Text

    Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.

Instances

Instances details
ToJSON CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

ToHeaders CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Methods

toHeaders :: CreateTrail -> [Header] #

ToPath CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

ToQuery CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

AWSRequest CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Associated Types

type AWSResponse CreateTrail #

Generic CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Associated Types

type Rep CreateTrail :: Type -> Type #

Read CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Show CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

NFData CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Methods

rnf :: CreateTrail -> () #

Eq CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Hashable CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

type AWSResponse CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

type Rep CreateTrail Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

type Rep CreateTrail = D1 ('MetaData "CreateTrail" "Amazonka.CloudTrail.CreateTrail" "amazonka-cloudtrail-2.0-6vmpMB1YeZzDIMmexWGsF3" 'False) (C1 ('MetaCons "CreateTrail'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cloudWatchLogsLogGroupArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "cloudWatchLogsRoleArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "enableLogFileValidation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)))) :*: (S1 ('MetaSel ('Just "includeGlobalServiceEvents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "isMultiRegionTrail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "isOrganizationTrail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "kmsKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "s3KeyPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "snsTopicName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "tagsList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag])) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "s3BucketName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))))

newCreateTrail Source #

Create a value of CreateTrail with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateTrail, createTrail_cloudWatchLogsLogGroupArn - Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.

CreateTrail, createTrail_cloudWatchLogsRoleArn - Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.

$sel:enableLogFileValidation:CreateTrail', createTrail_enableLogFileValidation - Specifies whether log file integrity validation is enabled. The default is false.

When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.

CreateTrail, createTrail_includeGlobalServiceEvents - Specifies whether the trail is publishing events from global services such as IAM to the log files.

CreateTrail, createTrail_isMultiRegionTrail - Specifies whether the trail is created in the current region or in all regions. The default is false, which creates a trail only in the region where you are signed in. As a best practice, consider creating trails that log events in all regions.

CreateTrail, createTrail_isOrganizationTrail - Specifies whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations.

CreateTrail, createTrail_kmsKeyId - Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by alias/, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.

CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.

Examples:

  • alias/MyAliasName
  • arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
  • arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  • 12345678-1234-1234-1234-123456789012

CreateTrail, createTrail_s3KeyPrefix - Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

CreateTrail, createTrail_snsTopicName - Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.

CreateTrail, createTrail_tagsList - Undocumented member.

CreateTrail, createTrail_name - Specifies the name of the trail. The name must meet the following requirements:

  • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
  • Start with a letter or number, and end with a letter or number
  • Be between 3 and 128 characters
  • Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are not valid.
  • Not be in IP address format (for example, 192.168.5.4)

CreateTrail, createTrail_s3BucketName - Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.

Request Lenses

createTrail_cloudWatchLogsLogGroupArn :: Lens' CreateTrail (Maybe Text) Source #

Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.

createTrail_cloudWatchLogsRoleArn :: Lens' CreateTrail (Maybe Text) Source #

Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.

createTrail_enableLogFileValidation :: Lens' CreateTrail (Maybe Bool) Source #

Specifies whether log file integrity validation is enabled. The default is false.

When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.

createTrail_includeGlobalServiceEvents :: Lens' CreateTrail (Maybe Bool) Source #

Specifies whether the trail is publishing events from global services such as IAM to the log files.

createTrail_isMultiRegionTrail :: Lens' CreateTrail (Maybe Bool) Source #

Specifies whether the trail is created in the current region or in all regions. The default is false, which creates a trail only in the region where you are signed in. As a best practice, consider creating trails that log events in all regions.

createTrail_isOrganizationTrail :: Lens' CreateTrail (Maybe Bool) Source #

Specifies whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations.

createTrail_kmsKeyId :: Lens' CreateTrail (Maybe Text) Source #

Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by alias/, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.

CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.

Examples:

  • alias/MyAliasName
  • arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
  • arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  • 12345678-1234-1234-1234-123456789012

createTrail_s3KeyPrefix :: Lens' CreateTrail (Maybe Text) Source #

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

createTrail_snsTopicName :: Lens' CreateTrail (Maybe Text) Source #

Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.

createTrail_name :: Lens' CreateTrail Text Source #

Specifies the name of the trail. The name must meet the following requirements:

  • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
  • Start with a letter or number, and end with a letter or number
  • Be between 3 and 128 characters
  • Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are not valid.
  • Not be in IP address format (for example, 192.168.5.4)

createTrail_s3BucketName :: Lens' CreateTrail Text Source #

Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.

Destructuring the Response

data CreateTrailResponse Source #

Returns the objects or data listed below if successful. Otherwise, returns an error.

See: newCreateTrailResponse smart constructor.

Constructors

CreateTrailResponse' 

Fields

Instances

Instances details
Generic CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Associated Types

type Rep CreateTrailResponse :: Type -> Type #

Read CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Show CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

NFData CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

Methods

rnf :: CreateTrailResponse -> () #

Eq CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

type Rep CreateTrailResponse Source # 
Instance details

Defined in Amazonka.CloudTrail.CreateTrail

type Rep CreateTrailResponse = D1 ('MetaData "CreateTrailResponse" "Amazonka.CloudTrail.CreateTrail" "amazonka-cloudtrail-2.0-6vmpMB1YeZzDIMmexWGsF3" 'False) (C1 ('MetaCons "CreateTrailResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cloudWatchLogsLogGroupArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "cloudWatchLogsRoleArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "includeGlobalServiceEvents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)))) :*: ((S1 ('MetaSel ('Just "isMultiRegionTrail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "isOrganizationTrail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "kmsKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "logFileValidationEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "s3BucketName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "s3KeyPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "snsTopicARN") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "snsTopicName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "trailARN") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))))

newCreateTrailResponse Source #

Create a value of CreateTrailResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateTrail, createTrailResponse_cloudWatchLogsLogGroupArn - Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.

CreateTrail, createTrailResponse_cloudWatchLogsRoleArn - Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.

CreateTrail, createTrailResponse_includeGlobalServiceEvents - Specifies whether the trail is publishing events from global services such as IAM to the log files.

CreateTrail, createTrailResponse_isMultiRegionTrail - Specifies whether the trail exists in one region or in all regions.

CreateTrail, createTrailResponse_isOrganizationTrail - Specifies whether the trail is an organization trail.

CreateTrail, createTrailResponse_kmsKeyId - Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.

arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012

CreateTrailResponse, createTrailResponse_logFileValidationEnabled - Specifies whether log file integrity validation is enabled.

CreateTrail, createTrailResponse_name - Specifies the name of the trail.

CreateTrail, createTrailResponse_s3BucketName - Specifies the name of the Amazon S3 bucket designated for publishing log files.

CreateTrail, createTrailResponse_s3KeyPrefix - Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.

CreateTrailResponse, createTrailResponse_snsTopicARN - Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:

arn:aws:sns:us-east-2:123456789012:MyTopic

CreateTrail, createTrailResponse_snsTopicName - This field is no longer in use. Use SnsTopicARN.

CreateTrailResponse, createTrailResponse_trailARN - Specifies the ARN of the trail that was created. The format of a trail ARN is:

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

$sel:httpStatus:CreateTrailResponse', createTrailResponse_httpStatus - The response's http status code.

Response Lenses

createTrailResponse_cloudWatchLogsLogGroupArn :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.

createTrailResponse_cloudWatchLogsRoleArn :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.

createTrailResponse_includeGlobalServiceEvents :: Lens' CreateTrailResponse (Maybe Bool) Source #

Specifies whether the trail is publishing events from global services such as IAM to the log files.

createTrailResponse_isMultiRegionTrail :: Lens' CreateTrailResponse (Maybe Bool) Source #

Specifies whether the trail exists in one region or in all regions.

createTrailResponse_isOrganizationTrail :: Lens' CreateTrailResponse (Maybe Bool) Source #

Specifies whether the trail is an organization trail.

createTrailResponse_kmsKeyId :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.

arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012

createTrailResponse_logFileValidationEnabled :: Lens' CreateTrailResponse (Maybe Bool) Source #

Specifies whether log file integrity validation is enabled.

createTrailResponse_name :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the name of the trail.

createTrailResponse_s3BucketName :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the name of the Amazon S3 bucket designated for publishing log files.

createTrailResponse_s3KeyPrefix :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.

createTrailResponse_snsTopicARN :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:

arn:aws:sns:us-east-2:123456789012:MyTopic

createTrailResponse_snsTopicName :: Lens' CreateTrailResponse (Maybe Text) Source #

This field is no longer in use. Use SnsTopicARN.

createTrailResponse_trailARN :: Lens' CreateTrailResponse (Maybe Text) Source #

Specifies the ARN of the trail that was created. The format of a trail ARN is:

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail