aws_sdk_ec2/client/
create_flow_logs.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateFlowLogs`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`dry_run(bool)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_dry_run):<br>required: **false**<br><p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p><br>
7    ///   - [`client_token(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_client_token):<br>required: **false**<br><p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p><br>
8    ///   - [`deliver_logs_permission_arn(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::deliver_logs_permission_arn) / [`set_deliver_logs_permission_arn(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_deliver_logs_permission_arn):<br>required: **false**<br><p>The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the log destination.</p> <p>This parameter is required if the destination type is <code>cloud-watch-logs</code>, or if the destination type is <code>kinesis-data-firehose</code> and the delivery stream and the resources to monitor are in different accounts.</p><br>
9    ///   - [`deliver_cross_account_role(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::deliver_cross_account_role) / [`set_deliver_cross_account_role(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_deliver_cross_account_role):<br>required: **false**<br><p>The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.</p><br>
10    ///   - [`log_group_name(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::log_group_name) / [`set_log_group_name(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_log_group_name):<br>required: **false**<br><p>The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.</p> <p>This parameter is valid only if the destination type is <code>cloud-watch-logs</code>.</p><br>
11    ///   - [`resource_ids(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::resource_ids) / [`set_resource_ids(Option<Vec::<String>>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_resource_ids):<br>required: **true**<br><p>The IDs of the resources to monitor. For example, if the resource type is <code>VPC</code>, specify the IDs of the VPCs.</p> <p>Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types.</p><br>
12    ///   - [`resource_type(FlowLogsResourceType)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::resource_type) / [`set_resource_type(Option<FlowLogsResourceType>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_resource_type):<br>required: **true**<br><p>The type of resource to monitor.</p><br>
13    ///   - [`traffic_type(TrafficType)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::traffic_type) / [`set_traffic_type(Option<TrafficType>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_traffic_type):<br>required: **false**<br><p>The type of traffic to monitor (accepted traffic, rejected traffic, or all traffic). This parameter is not supported for transit gateway resource types. It is required for the other resource types.</p><br>
14    ///   - [`log_destination_type(LogDestinationType)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::log_destination_type) / [`set_log_destination_type(Option<LogDestinationType>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_log_destination_type):<br>required: **false**<br><p>The type of destination for the flow log data.</p> <p>Default: <code>cloud-watch-logs</code></p><br>
15    ///   - [`log_destination(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::log_destination) / [`set_log_destination(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_log_destination):<br>required: **false**<br><p>The destination for the flow log data. The meaning of this parameter depends on the destination type.</p> <ul>  <li>   <p>If the destination type is <code>cloud-watch-logs</code>, specify the ARN of a CloudWatch Logs log group. For example:</p>   <p>arn:aws:logs:<i>region</i>:<i>account_id</i>:log-group:<i>my_group</i></p>   <p>Alternatively, use the <code>LogGroupName</code> parameter.</p></li>  <li>   <p>If the destination type is <code>s3</code>, specify the ARN of an S3 bucket. For example:</p>   <p>arn:aws:s3:::<i>my_bucket</i>/<i>my_subfolder</i>/</p>   <p>The subfolder is optional. Note that you can't use <code>AWSLogs</code> as a subfolder name.</p></li>  <li>   <p>If the destination type is <code>kinesis-data-firehose</code>, specify the ARN of a Kinesis Data Firehose delivery stream. For example:</p>   <p>arn:aws:firehose:<i>region</i>:<i>account_id</i>:deliverystream:<i>my_stream</i></p></li> </ul><br>
16    ///   - [`log_format(impl Into<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::log_format) / [`set_log_format(Option<String>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_log_format):<br>required: **false**<br><p>The fields to include in the flow log record. List the fields in the order in which they should appear. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must include at least one field. For more information about the available fields, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html">Flow log records</a> in the <i>Amazon VPC User Guide</i> or <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-flow-logs.html#flow-log-records">Transit Gateway Flow Log records</a> in the <i>Amazon Web Services Transit Gateway Guide</i>.</p> <p>Specify the fields using the <code>${field-id}</code> format, separated by spaces.</p><br>
17    ///   - [`tag_specifications(TagSpecification)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::tag_specifications) / [`set_tag_specifications(Option<Vec::<TagSpecification>>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_tag_specifications):<br>required: **false**<br><p>The tags to apply to the flow logs.</p><br>
18    ///   - [`max_aggregation_interval(i32)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::max_aggregation_interval) / [`set_max_aggregation_interval(Option<i32>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_max_aggregation_interval):<br>required: **false**<br><p>The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. The possible values are 60 seconds (1 minute) or 600 seconds (10 minutes). This parameter must be 60 seconds for transit gateway resource types.</p> <p>When a network interface is attached to a <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">Nitro-based instance</a>, the aggregation interval is always 60 seconds or less, regardless of the value that you specify.</p> <p>Default: 600</p><br>
19    ///   - [`destination_options(DestinationOptionsRequest)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::destination_options) / [`set_destination_options(Option<DestinationOptionsRequest>)`](crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::set_destination_options):<br>required: **false**<br><p>The destination options.</p><br>
20    /// - On success, responds with [`CreateFlowLogsOutput`](crate::operation::create_flow_logs::CreateFlowLogsOutput) with field(s):
21    ///   - [`client_token(Option<String>)`](crate::operation::create_flow_logs::CreateFlowLogsOutput::client_token): <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
22    ///   - [`flow_log_ids(Option<Vec::<String>>)`](crate::operation::create_flow_logs::CreateFlowLogsOutput::flow_log_ids): <p>The IDs of the flow logs.</p>
23    ///   - [`unsuccessful(Option<Vec::<UnsuccessfulItem>>)`](crate::operation::create_flow_logs::CreateFlowLogsOutput::unsuccessful): <p>Information about the flow logs that could not be created successfully.</p>
24    /// - On failure, responds with [`SdkError<CreateFlowLogsError>`](crate::operation::create_flow_logs::CreateFlowLogsError)
25    pub fn create_flow_logs(&self) -> crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder {
26        crate::operation::create_flow_logs::builders::CreateFlowLogsFluentBuilder::new(self.handle.clone())
27    }
28}