Struct aws_sdk_ec2::client::fluent_builders::CreateFlowLogs
source · [−]pub struct CreateFlowLogs { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateFlowLogs
.
Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC.
Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see Flow log records in the Amazon Virtual Private Cloud User Guide.
When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket.
For more information, see VPC Flow Logs in the Amazon Virtual Private Cloud User Guide.
Implementations
sourceimpl CreateFlowLogs
impl CreateFlowLogs
sourcepub async fn send(
self
) -> Result<CreateFlowLogsOutput, SdkError<CreateFlowLogsError>>
pub async fn send(
self
) -> Result<CreateFlowLogsOutput, SdkError<CreateFlowLogsError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
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 DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
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 DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
sourcepub fn deliver_logs_permission_arn(self, input: impl Into<String>) -> Self
pub fn deliver_logs_permission_arn(self, input: impl Into<String>) -> Self
The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
sourcepub fn set_deliver_logs_permission_arn(self, input: Option<String>) -> Self
pub fn set_deliver_logs_permission_arn(self, input: Option<String>) -> Self
The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
sourcepub fn log_group_name(self, input: impl Into<String>) -> Self
pub fn log_group_name(self, input: impl Into<String>) -> Self
The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
sourcepub fn set_log_group_name(self, input: Option<String>) -> Self
pub fn set_log_group_name(self, input: Option<String>) -> Self
The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
sourcepub fn resource_ids(self, input: impl Into<String>) -> Self
pub fn resource_ids(self, input: impl Into<String>) -> Self
Appends an item to ResourceIds
.
To override the contents of this collection use set_resource_ids
.
The ID of the subnet, network interface, or VPC for which you want to create a flow log.
Constraints: Maximum of 1000 resources
sourcepub fn set_resource_ids(self, input: Option<Vec<String>>) -> Self
pub fn set_resource_ids(self, input: Option<Vec<String>>) -> Self
The ID of the subnet, network interface, or VPC for which you want to create a flow log.
Constraints: Maximum of 1000 resources
sourcepub fn resource_type(self, input: FlowLogsResourceType) -> Self
pub fn resource_type(self, input: FlowLogsResourceType) -> Self
The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId
property, specify VPC
for this property.
sourcepub fn set_resource_type(self, input: Option<FlowLogsResourceType>) -> Self
pub fn set_resource_type(self, input: Option<FlowLogsResourceType>) -> Self
The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId
property, specify VPC
for this property.
sourcepub fn traffic_type(self, input: TrafficType) -> Self
pub fn traffic_type(self, input: TrafficType) -> Self
The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
sourcepub fn set_traffic_type(self, input: Option<TrafficType>) -> Self
pub fn set_traffic_type(self, input: Option<TrafficType>) -> Self
The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
sourcepub fn log_destination_type(self, input: LogDestinationType) -> Self
pub fn log_destination_type(self, input: LogDestinationType) -> Self
The type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3. To publish flow log data to CloudWatch Logs, specify cloud-watch-logs
. To publish flow log data to Amazon S3, specify s3
.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
Default: cloud-watch-logs
sourcepub fn set_log_destination_type(self, input: Option<LogDestinationType>) -> Self
pub fn set_log_destination_type(self, input: Option<LogDestinationType>) -> Self
The type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3. To publish flow log data to CloudWatch Logs, specify cloud-watch-logs
. To publish flow log data to Amazon S3, specify s3
.
If you specify LogDestinationType
as s3
, do not specify DeliverLogsPermissionArn
or LogGroupName
.
Default: cloud-watch-logs
sourcepub fn log_destination(self, input: impl Into<String>) -> Self
pub fn log_destination(self, input: impl Into<String>) -> Self
The destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group or an Amazon S3 bucket. The value specified for this parameter depends on the value specified for LogDestinationType
.
If LogDestinationType
is not specified or cloud-watch-logs
, specify the Amazon Resource Name (ARN) of the CloudWatch Logs log group. For example, to publish to a log group called my-logs
, specify arn:aws:logs:us-east-1:123456789012:log-group:my-logs
. Alternatively, use LogGroupName
instead.
If LogDestinationType is s3
, specify the ARN of the Amazon S3 bucket. You can also specify a subfolder in the bucket. To specify a subfolder in the bucket, use the following ARN format: bucket_ARN/subfolder_name/
. For example, to specify a subfolder named my-logs
in a bucket named my-bucket
, use the following ARN: arn:aws:s3:::my-bucket/my-logs/
. You cannot use AWSLogs
as a subfolder name. This is a reserved term.
sourcepub fn set_log_destination(self, input: Option<String>) -> Self
pub fn set_log_destination(self, input: Option<String>) -> Self
The destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group or an Amazon S3 bucket. The value specified for this parameter depends on the value specified for LogDestinationType
.
If LogDestinationType
is not specified or cloud-watch-logs
, specify the Amazon Resource Name (ARN) of the CloudWatch Logs log group. For example, to publish to a log group called my-logs
, specify arn:aws:logs:us-east-1:123456789012:log-group:my-logs
. Alternatively, use LogGroupName
instead.
If LogDestinationType is s3
, specify the ARN of the Amazon S3 bucket. You can also specify a subfolder in the bucket. To specify a subfolder in the bucket, use the following ARN format: bucket_ARN/subfolder_name/
. For example, to specify a subfolder named my-logs
in a bucket named my-bucket
, use the following ARN: arn:aws:s3:::my-bucket/my-logs/
. You cannot use AWSLogs
as a subfolder name. This is a reserved term.
sourcepub fn log_format(self, input: impl Into<String>) -> Self
pub fn log_format(self, input: impl Into<String>) -> Self
The fields to include in the flow log record, in the order in which they should appear. For a list of available fields, see Flow log records. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must specify at least one field.
Specify the fields using the ${field-id}
format, separated by spaces. For the CLI, surround this parameter value with single quotes on Linux or double quotes on Windows.
sourcepub fn set_log_format(self, input: Option<String>) -> Self
pub fn set_log_format(self, input: Option<String>) -> Self
The fields to include in the flow log record, in the order in which they should appear. For a list of available fields, see Flow log records. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must specify at least one field.
Specify the fields using the ${field-id}
format, separated by spaces. For the CLI, surround this parameter value with single quotes on Linux or double quotes on Windows.
sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to TagSpecifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to apply to the flow logs.
sourcepub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
pub fn set_tag_specifications(self, input: Option<Vec<TagSpecification>>) -> Self
The tags to apply to the flow logs.
sourcepub fn max_aggregation_interval(self, input: i32) -> Self
pub fn max_aggregation_interval(self, input: i32) -> Self
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
When a network interface is attached to a Nitro-based instance, the aggregation interval is always 60 seconds or less, regardless of the value that you specify.
Default: 600
sourcepub fn set_max_aggregation_interval(self, input: Option<i32>) -> Self
pub fn set_max_aggregation_interval(self, input: Option<i32>) -> Self
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
When a network interface is attached to a Nitro-based instance, the aggregation interval is always 60 seconds or less, regardless of the value that you specify.
Default: 600
sourcepub fn destination_options(self, input: DestinationOptionsRequest) -> Self
pub fn destination_options(self, input: DestinationOptionsRequest) -> Self
The destination options.
sourcepub fn set_destination_options(
self,
input: Option<DestinationOptionsRequest>
) -> Self
pub fn set_destination_options(
self,
input: Option<DestinationOptionsRequest>
) -> Self
The destination options.
Trait Implementations
sourceimpl Clone for CreateFlowLogs
impl Clone for CreateFlowLogs
sourcefn clone(&self) -> CreateFlowLogs
fn clone(&self) -> CreateFlowLogs
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for CreateFlowLogs
impl Send for CreateFlowLogs
impl Sync for CreateFlowLogs
impl Unpin for CreateFlowLogs
impl !UnwindSafe for CreateFlowLogs
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more