aws_sdk_cloudtrail/operation/create_trail/
_create_trail_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the settings for each trail.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTrailInput {
7    /// <p>Specifies the name of the trail. The name must meet the following requirements:</p>
8    /// <ul>
9    /// <li>
10    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
11    /// <li>
12    /// <p>Start with a letter or number, and end with a letter or number</p></li>
13    /// <li>
14    /// <p>Be between 3 and 128 characters</p></li>
15    /// <li>
16    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
17    /// <li>
18    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
19    /// </ul>
20    pub name: ::std::option::Option<::std::string::String>,
21    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
22    pub s3_bucket_name: ::std::option::Option<::std::string::String>,
23    /// <p>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 <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
24    pub s3_key_prefix: ::std::option::Option<::std::string::String>,
25    /// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
26    pub sns_topic_name: ::std::option::Option<::std::string::String>,
27    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
28    pub include_global_service_events: ::std::option::Option<bool>,
29    /// <p>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.</p>
30    pub is_multi_region_trail: ::std::option::Option<bool>,
31    /// <p>Specifies whether log file integrity validation is enabled. The default is false.</p><note>
32    /// <p>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.</p>
33    /// </note>
34    pub enable_log_file_validation: ::std::option::Option<bool>,
35    /// <p>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. You must use a log group that exists in your account.</p>
36    /// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
37    pub cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
38    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
39    pub cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
40    /// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
41    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
42    /// <p>Examples:</p>
43    /// <ul>
44    /// <li>
45    /// <p><code>alias/MyAliasName</code></p></li>
46    /// <li>
47    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
48    /// <li>
49    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
50    /// <li>
51    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
52    /// </ul>
53    pub kms_key_id: ::std::option::Option<::std::string::String>,
54    /// <p>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 or delegated administrator account for an organization in Organizations.</p>
55    pub is_organization_trail: ::std::option::Option<bool>,
56    /// <p>A list of tags.</p>
57    pub tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
58}
59impl CreateTrailInput {
60    /// <p>Specifies the name of the trail. The name must meet the following requirements:</p>
61    /// <ul>
62    /// <li>
63    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
64    /// <li>
65    /// <p>Start with a letter or number, and end with a letter or number</p></li>
66    /// <li>
67    /// <p>Be between 3 and 128 characters</p></li>
68    /// <li>
69    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
70    /// <li>
71    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
72    /// </ul>
73    pub fn name(&self) -> ::std::option::Option<&str> {
74        self.name.as_deref()
75    }
76    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
77    pub fn s3_bucket_name(&self) -> ::std::option::Option<&str> {
78        self.s3_bucket_name.as_deref()
79    }
80    /// <p>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 <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
81    pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
82        self.s3_key_prefix.as_deref()
83    }
84    /// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
85    pub fn sns_topic_name(&self) -> ::std::option::Option<&str> {
86        self.sns_topic_name.as_deref()
87    }
88    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
89    pub fn include_global_service_events(&self) -> ::std::option::Option<bool> {
90        self.include_global_service_events
91    }
92    /// <p>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.</p>
93    pub fn is_multi_region_trail(&self) -> ::std::option::Option<bool> {
94        self.is_multi_region_trail
95    }
96    /// <p>Specifies whether log file integrity validation is enabled. The default is false.</p><note>
97    /// <p>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.</p>
98    /// </note>
99    pub fn enable_log_file_validation(&self) -> ::std::option::Option<bool> {
100        self.enable_log_file_validation
101    }
102    /// <p>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. You must use a log group that exists in your account.</p>
103    /// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
104    pub fn cloud_watch_logs_log_group_arn(&self) -> ::std::option::Option<&str> {
105        self.cloud_watch_logs_log_group_arn.as_deref()
106    }
107    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
108    pub fn cloud_watch_logs_role_arn(&self) -> ::std::option::Option<&str> {
109        self.cloud_watch_logs_role_arn.as_deref()
110    }
111    /// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
112    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
113    /// <p>Examples:</p>
114    /// <ul>
115    /// <li>
116    /// <p><code>alias/MyAliasName</code></p></li>
117    /// <li>
118    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
119    /// <li>
120    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
121    /// <li>
122    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
123    /// </ul>
124    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
125        self.kms_key_id.as_deref()
126    }
127    /// <p>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 or delegated administrator account for an organization in Organizations.</p>
128    pub fn is_organization_trail(&self) -> ::std::option::Option<bool> {
129        self.is_organization_trail
130    }
131    /// <p>A list of tags.</p>
132    ///
133    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags_list.is_none()`.
134    pub fn tags_list(&self) -> &[crate::types::Tag] {
135        self.tags_list.as_deref().unwrap_or_default()
136    }
137}
138impl CreateTrailInput {
139    /// Creates a new builder-style object to manufacture [`CreateTrailInput`](crate::operation::create_trail::CreateTrailInput).
140    pub fn builder() -> crate::operation::create_trail::builders::CreateTrailInputBuilder {
141        crate::operation::create_trail::builders::CreateTrailInputBuilder::default()
142    }
143}
144
145/// A builder for [`CreateTrailInput`](crate::operation::create_trail::CreateTrailInput).
146#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
147#[non_exhaustive]
148pub struct CreateTrailInputBuilder {
149    pub(crate) name: ::std::option::Option<::std::string::String>,
150    pub(crate) s3_bucket_name: ::std::option::Option<::std::string::String>,
151    pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
152    pub(crate) sns_topic_name: ::std::option::Option<::std::string::String>,
153    pub(crate) include_global_service_events: ::std::option::Option<bool>,
154    pub(crate) is_multi_region_trail: ::std::option::Option<bool>,
155    pub(crate) enable_log_file_validation: ::std::option::Option<bool>,
156    pub(crate) cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
157    pub(crate) cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
158    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
159    pub(crate) is_organization_trail: ::std::option::Option<bool>,
160    pub(crate) tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
161}
162impl CreateTrailInputBuilder {
163    /// <p>Specifies the name of the trail. The name must meet the following requirements:</p>
164    /// <ul>
165    /// <li>
166    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
167    /// <li>
168    /// <p>Start with a letter or number, and end with a letter or number</p></li>
169    /// <li>
170    /// <p>Be between 3 and 128 characters</p></li>
171    /// <li>
172    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
173    /// <li>
174    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
175    /// </ul>
176    /// This field is required.
177    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.name = ::std::option::Option::Some(input.into());
179        self
180    }
181    /// <p>Specifies the name of the trail. The name must meet the following requirements:</p>
182    /// <ul>
183    /// <li>
184    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
185    /// <li>
186    /// <p>Start with a letter or number, and end with a letter or number</p></li>
187    /// <li>
188    /// <p>Be between 3 and 128 characters</p></li>
189    /// <li>
190    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
191    /// <li>
192    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
193    /// </ul>
194    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.name = input;
196        self
197    }
198    /// <p>Specifies the name of the trail. The name must meet the following requirements:</p>
199    /// <ul>
200    /// <li>
201    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
202    /// <li>
203    /// <p>Start with a letter or number, and end with a letter or number</p></li>
204    /// <li>
205    /// <p>Be between 3 and 128 characters</p></li>
206    /// <li>
207    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
208    /// <li>
209    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
210    /// </ul>
211    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
212        &self.name
213    }
214    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
215    /// This field is required.
216    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.s3_bucket_name = ::std::option::Option::Some(input.into());
218        self
219    }
220    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
221    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.s3_bucket_name = input;
223        self
224    }
225    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
226    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
227        &self.s3_bucket_name
228    }
229    /// <p>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 <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
230    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.s3_key_prefix = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>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 <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
235    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.s3_key_prefix = input;
237        self
238    }
239    /// <p>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 <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
240    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
241        &self.s3_key_prefix
242    }
243    /// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
244    pub fn sns_topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.sns_topic_name = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
249    pub fn set_sns_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.sns_topic_name = input;
251        self
252    }
253    /// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
254    pub fn get_sns_topic_name(&self) -> &::std::option::Option<::std::string::String> {
255        &self.sns_topic_name
256    }
257    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
258    pub fn include_global_service_events(mut self, input: bool) -> Self {
259        self.include_global_service_events = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
263    pub fn set_include_global_service_events(mut self, input: ::std::option::Option<bool>) -> Self {
264        self.include_global_service_events = input;
265        self
266    }
267    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
268    pub fn get_include_global_service_events(&self) -> &::std::option::Option<bool> {
269        &self.include_global_service_events
270    }
271    /// <p>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.</p>
272    pub fn is_multi_region_trail(mut self, input: bool) -> Self {
273        self.is_multi_region_trail = ::std::option::Option::Some(input);
274        self
275    }
276    /// <p>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.</p>
277    pub fn set_is_multi_region_trail(mut self, input: ::std::option::Option<bool>) -> Self {
278        self.is_multi_region_trail = input;
279        self
280    }
281    /// <p>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.</p>
282    pub fn get_is_multi_region_trail(&self) -> &::std::option::Option<bool> {
283        &self.is_multi_region_trail
284    }
285    /// <p>Specifies whether log file integrity validation is enabled. The default is false.</p><note>
286    /// <p>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.</p>
287    /// </note>
288    pub fn enable_log_file_validation(mut self, input: bool) -> Self {
289        self.enable_log_file_validation = ::std::option::Option::Some(input);
290        self
291    }
292    /// <p>Specifies whether log file integrity validation is enabled. The default is false.</p><note>
293    /// <p>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.</p>
294    /// </note>
295    pub fn set_enable_log_file_validation(mut self, input: ::std::option::Option<bool>) -> Self {
296        self.enable_log_file_validation = input;
297        self
298    }
299    /// <p>Specifies whether log file integrity validation is enabled. The default is false.</p><note>
300    /// <p>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.</p>
301    /// </note>
302    pub fn get_enable_log_file_validation(&self) -> &::std::option::Option<bool> {
303        &self.enable_log_file_validation
304    }
305    /// <p>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. You must use a log group that exists in your account.</p>
306    /// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
307    pub fn cloud_watch_logs_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308        self.cloud_watch_logs_log_group_arn = ::std::option::Option::Some(input.into());
309        self
310    }
311    /// <p>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. You must use a log group that exists in your account.</p>
312    /// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
313    pub fn set_cloud_watch_logs_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
314        self.cloud_watch_logs_log_group_arn = input;
315        self
316    }
317    /// <p>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. You must use a log group that exists in your account.</p>
318    /// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
319    pub fn get_cloud_watch_logs_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
320        &self.cloud_watch_logs_log_group_arn
321    }
322    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
323    pub fn cloud_watch_logs_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
324        self.cloud_watch_logs_role_arn = ::std::option::Option::Some(input.into());
325        self
326    }
327    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
328    pub fn set_cloud_watch_logs_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
329        self.cloud_watch_logs_role_arn = input;
330        self
331    }
332    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
333    pub fn get_cloud_watch_logs_role_arn(&self) -> &::std::option::Option<::std::string::String> {
334        &self.cloud_watch_logs_role_arn
335    }
336    /// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
337    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
338    /// <p>Examples:</p>
339    /// <ul>
340    /// <li>
341    /// <p><code>alias/MyAliasName</code></p></li>
342    /// <li>
343    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
344    /// <li>
345    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
346    /// <li>
347    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
348    /// </ul>
349    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
350        self.kms_key_id = ::std::option::Option::Some(input.into());
351        self
352    }
353    /// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
354    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
355    /// <p>Examples:</p>
356    /// <ul>
357    /// <li>
358    /// <p><code>alias/MyAliasName</code></p></li>
359    /// <li>
360    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
361    /// <li>
362    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
363    /// <li>
364    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
365    /// </ul>
366    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
367        self.kms_key_id = input;
368        self
369    }
370    /// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
371    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
372    /// <p>Examples:</p>
373    /// <ul>
374    /// <li>
375    /// <p><code>alias/MyAliasName</code></p></li>
376    /// <li>
377    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
378    /// <li>
379    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
380    /// <li>
381    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
382    /// </ul>
383    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
384        &self.kms_key_id
385    }
386    /// <p>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 or delegated administrator account for an organization in Organizations.</p>
387    pub fn is_organization_trail(mut self, input: bool) -> Self {
388        self.is_organization_trail = ::std::option::Option::Some(input);
389        self
390    }
391    /// <p>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 or delegated administrator account for an organization in Organizations.</p>
392    pub fn set_is_organization_trail(mut self, input: ::std::option::Option<bool>) -> Self {
393        self.is_organization_trail = input;
394        self
395    }
396    /// <p>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 or delegated administrator account for an organization in Organizations.</p>
397    pub fn get_is_organization_trail(&self) -> &::std::option::Option<bool> {
398        &self.is_organization_trail
399    }
400    /// Appends an item to `tags_list`.
401    ///
402    /// To override the contents of this collection use [`set_tags_list`](Self::set_tags_list).
403    ///
404    /// <p>A list of tags.</p>
405    pub fn tags_list(mut self, input: crate::types::Tag) -> Self {
406        let mut v = self.tags_list.unwrap_or_default();
407        v.push(input);
408        self.tags_list = ::std::option::Option::Some(v);
409        self
410    }
411    /// <p>A list of tags.</p>
412    pub fn set_tags_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
413        self.tags_list = input;
414        self
415    }
416    /// <p>A list of tags.</p>
417    pub fn get_tags_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
418        &self.tags_list
419    }
420    /// Consumes the builder and constructs a [`CreateTrailInput`](crate::operation::create_trail::CreateTrailInput).
421    pub fn build(self) -> ::std::result::Result<crate::operation::create_trail::CreateTrailInput, ::aws_smithy_types::error::operation::BuildError> {
422        ::std::result::Result::Ok(crate::operation::create_trail::CreateTrailInput {
423            name: self.name,
424            s3_bucket_name: self.s3_bucket_name,
425            s3_key_prefix: self.s3_key_prefix,
426            sns_topic_name: self.sns_topic_name,
427            include_global_service_events: self.include_global_service_events,
428            is_multi_region_trail: self.is_multi_region_trail,
429            enable_log_file_validation: self.enable_log_file_validation,
430            cloud_watch_logs_log_group_arn: self.cloud_watch_logs_log_group_arn,
431            cloud_watch_logs_role_arn: self.cloud_watch_logs_role_arn,
432            kms_key_id: self.kms_key_id,
433            is_organization_trail: self.is_organization_trail,
434            tags_list: self.tags_list,
435        })
436    }
437}