AWS SDK for .NET Documentation
CreateTrail Method (createTrailRequest)
Amazon ► Amazon.CloudTrail ► AmazonCloudTrailClient ► CreateTrail(CreateTrailRequest)
Did this page help you? Yes No Tell us about it...

From the command line, use create-subscription.

Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. The request includes a Trail structure that specifies the following:

- Trail name.
- The name of an existing Amazon S3 bucket to which CloudTrail delivers your log files.
- The name of the Amazon S3 key prefix that precedes each log file.
- The name of an existing Amazon SNS topic that notifies you that a new file is available in your bucket.
- Whether the log file should include AWS API calls from global services. Currently, the only global AWS API calls included in CloudTrail log files are from IAM and AWS STS.

Declaration Syntax

C#

    public CreateTrailResponse CreateTrail(
    	CreateTrailRequest createTrailRequest
    )

Parameters

createTrailRequest (CreateTrailRequest)
  Container for the necessary parameters to execute the CreateTrail service method on AmazonCloudTrail.

Return Value
The response from the CreateTrail service method, as returned by AmazonCloudTrail.
Exceptions

Exception | Condition
--- | ---
S3BucketDoesNotExistException |
InvalidS3PrefixException |
InvalidTrailNameException |
TrailAlreadyExistsException |
MaximumNumberOfTrailsExceededException |
InvalidS3BucketNameException |
TrailNotProvidedException |
InsufficientSnsTopicPolicyException |
InvalidSnsTopicNameException |
InsufficientS3BucketPolicyException |

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)