@Override
    public CreateTrailResult createTrail(CreateTrailRequest request) {
        request = beforeClientExecution(request);
        return executeCreateTrail(request);
    }
@ Override public CreateTrailResult createTrail ( CreateTrailRequest request ) { request = beforeClientExecution ( request ) ; return executeCreateTrail ( request ) ; }
<p>
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five
trails can exist in a region, irrespective of the region in which they were created.
</p>

@param createTrailRequest
Specifies the settings for each trail.
@return Result of the CreateTrail operation returned by the service.
@throws MaximumNumberOfTrailsExceededException
This exception is thrown when the maximum number of trails is reached.
@throws TrailAlreadyExistsException
This exception is thrown when the specified trail already exists.
@throws S3BucketDoesNotExistException
This exception is thrown when the specified S3 bucket does not exist.
@throws InsufficientS3BucketPolicyException
This exception is thrown when the policy on the S3 bucket is not sufficient.
@throws InsufficientSnsTopicPolicyException
This exception is thrown when the policy on the SNS topic is not sufficient.
@throws InsufficientEncryptionPolicyException
This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
@throws InvalidS3BucketNameException
This exception is thrown when the provided S3 bucket name is not valid.
@throws InvalidS3PrefixException
This exception is thrown when the provided S3 prefix is not valid.
@throws InvalidSnsTopicNameException
This exception is thrown when the provided SNS topic name is not valid.
@throws InvalidKmsKeyIdException
This exception is thrown when the KMS key ARN is invalid.
@throws InvalidTrailNameException
This exception is thrown when the provided trail name is not valid. Trail names must meet the following
requirements:</p>
<ul>
<li>
<p>
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
</p>
</li>
<li>
<p>
Start with a letter or number, and end with a letter or number
</p>
</li>
<li>
<p>
Be between 3 and 128 characters
</p>
</li>
<li>
<p>
Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and
<code>my--namespace</code> are invalid.
</p>
</li>
<li>
<p>
Not be in IP address format (for example, 192.168.5.4)
</p>
</li>
@throws TrailNotProvidedException
This exception is deprecated.
@throws InvalidParameterCombinationException
This exception is thrown when the combination of parameters provided is not valid.
@throws KmsKeyNotFoundException
This exception is thrown when the KMS key does not exist, or when the S3 bucket and the KMS key are not
in the same region.
@throws KmsKeyDisabledException
This exception is deprecated.
@throws KmsException
This exception is thrown when there is an issue with the specified KMS key and the trail can’t be
updated.
@throws InvalidCloudWatchLogsLogGroupArnException
This exception is thrown when the provided CloudWatch log group is not valid.
@throws InvalidCloudWatchLogsRoleArnException
This exception is thrown when the provided role is not valid.
@throws CloudWatchLogsDeliveryUnavailableException
Cannot set a CloudWatch Logs delivery for this region.
@throws UnsupportedOperationException
This exception is thrown when the requested operation is not supported.
@throws OperationNotPermittedException
This exception is thrown when the requested operation is not permitted.
@throws CloudTrailAccessNotEnabledException
This exception is thrown when trusted access has not been enabled between AWS CloudTrail and AWS
Organizations. For more information, see <a
href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html">Enabling
Trusted Access with Other AWS Services</a> and <a href=
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html"
>Prepare For Creating a Trail For Your Organization</a>.
@throws InsufficientDependencyServiceAccessPermissionException
This exception is thrown when the IAM user or role that is used to create the organization trail is
lacking one or more required permissions for creating an organization trail in a required service. For
more information, see <a href=
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html"
>Prepare For Creating a Trail For Your Organization</a>.
@throws NotOrganizationMasterAccountException
This exception is thrown when the AWS account making the request to create or update an organization
trail is not the master account for an organization in AWS Organizations. For more information, see <a
href=
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html"
>Prepare For Creating a Trail For Your Organization</a>.
@throws OrganizationsNotInUseException
This exception is thrown when the request is made from an AWS account that is not a member of an
organization. To make this request, sign in using the credentials of an account that belongs to an
organization.
@throws OrganizationNotInAllFeaturesModeException
This exception is thrown when AWS Organizations is not configured to support all features. All features
must be enabled in AWS Organization to support creating an organization trail. For more information, see
<a href=
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html"
>Prepare For Creating a Trail For Your Organization</a>.
@sample AWSCloudTrail.CreateTrail
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail" target="_top">AWS API
Documentation</a>