/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateFlowLogsRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateFlowLogsRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see How
* to ensure idempotency.
*
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your
* account.
*
* This parameter is required if the destination type is
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.
*
* The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.
*
* This parameter is valid only if the destination type is
* The IDs of the resources to monitor. For example, if the resource type is
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types.
*
* The type of resource to monitor.
*
* 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.
*
* The type of destination for the flow log data.
*
* Default:
* The destination for the flow log data. The meaning of this parameter depends on the destination type.
*
* If the destination type is
* arn:aws:logs:region:account_id:log-group:my_group
*
* Alternatively, use the
* If the destination type is
* arn:aws:s3:::my_bucket/my_subfolder/
*
* The subfolder is optional. Note that you can't use
* If the destination type is
* arn:aws:firehose:region:account_id:deliverystream:my_stream
*
* 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 Flow log records in
* the Amazon VPC User Guide or Transit Gateway Flow Log
* records in the Amazon Web Services Transit Gateway Guide.
*
* Specify the fields using the
* The tags to apply to the flow logs.
*
* 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.
*
* 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
*
* The destination options.
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see How
* to ensure idempotency.
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see How
* to ensure idempotency.
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see How
* to ensure idempotency.
*
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your
* account.
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported otherwise.
* cloud-watch-logs
.
* VPC
, specify the IDs of
* the VPCs.
* cloud-watch-logs
*
*
*/
private String logDestination;
/**
* cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group. For
* example:
* LogGroupName
parameter.
* s3
, specify the ARN of an S3 bucket. For example:
* AWSLogs
as a subfolder name.
* kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
* ${field-id}
format, separated by spaces. For the CLI, surround this
* parameter value with single quotes on Linux or double quotes on Windows.
* cloud-watch-logs
and unsupported otherwise.
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported
* otherwise.
*/
public void setDeliverLogsPermissionArn(String deliverLogsPermissionArn) {
this.deliverLogsPermissionArn = deliverLogsPermissionArn;
}
/**
*
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your * account. *
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported otherwise.
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported
* otherwise.
*/
public String getDeliverLogsPermissionArn() {
return this.deliverLogsPermissionArn;
}
/**
*
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your * account. *
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported otherwise.
*
* This parameter is required if the destination type is cloud-watch-logs
and unsupported
* otherwise.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFlowLogsRequest withDeliverLogsPermissionArn(String deliverLogsPermissionArn) {
setDeliverLogsPermissionArn(deliverLogsPermissionArn);
return this;
}
/**
*
* The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. *
* * @param deliverCrossAccountRole * The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. */ public void setDeliverCrossAccountRole(String deliverCrossAccountRole) { this.deliverCrossAccountRole = deliverCrossAccountRole; } /** ** The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. *
* * @return The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. */ public String getDeliverCrossAccountRole() { return this.deliverCrossAccountRole; } /** ** The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. *
* * @param deliverCrossAccountRole * The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFlowLogsRequest withDeliverCrossAccountRole(String deliverCrossAccountRole) { setDeliverCrossAccountRole(deliverCrossAccountRole); return this; } /** ** The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. *
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
*/
public void setLogGroupName(String logGroupName) {
this.logGroupName = logGroupName;
}
/**
*
* The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. *
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
*/
public String getLogGroupName() {
return this.logGroupName;
}
/**
*
* The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. *
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
*
* This parameter is valid only if the destination type is cloud-watch-logs
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFlowLogsRequest withLogGroupName(String logGroupName) {
setLogGroupName(logGroupName);
return this;
}
/**
*
* The IDs of the resources to monitor. For example, if the resource type is VPC
, specify the IDs of
* the VPCs.
*
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types. *
* * @return The IDs of the resources to monitor. For example, if the resource type isVPC
, specify the
* IDs of the VPCs.
*
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource
* types.
*/
public java.util.List
* The IDs of the resources to monitor. For example, if the resource type is
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types.
* VPC
, specify the IDs of
* the VPCs.
* VPC
, specify the
* IDs of the VPCs.
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource
* types.
*/
public void setResourceIds(java.util.Collection
* The IDs of the resources to monitor. For example, if the resource type is
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceIds(java.util.Collection)} or {@link #withResourceIds(java.util.Collection)} if you want to
* override the existing values.
* VPC
, specify the IDs of
* the VPCs.
* VPC
, specify the
* IDs of the VPCs.
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource
* types.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFlowLogsRequest withResourceIds(String... resourceIds) {
if (this.resourceIds == null) {
setResourceIds(new com.amazonaws.internal.SdkInternalList
* The IDs of the resources to monitor. For example, if the resource type is
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource types.
* VPC
, specify the IDs of
* the VPCs.
* VPC
, specify the
* IDs of the VPCs.
* Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 for the other resource
* types.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFlowLogsRequest withResourceIds(java.util.Collection
* The type of resource to monitor.
*
* The type of resource to monitor.
*
* The type of resource to monitor.
*
* The type of resource to monitor.
*
* The type of resource to monitor.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* The type of destination for the flow log data.
*
* Default: cloud-watch-logs
*
* Default: cloud-watch-logs
* @see LogDestinationType
*/
public void setLogDestinationType(String logDestinationType) {
this.logDestinationType = logDestinationType;
}
/**
*
* The type of destination for the flow log data. *
*
* Default: cloud-watch-logs
*
* Default: cloud-watch-logs
* @see LogDestinationType
*/
public String getLogDestinationType() {
return this.logDestinationType;
}
/**
*
* The type of destination for the flow log data. *
*
* Default: cloud-watch-logs
*
* Default: cloud-watch-logs
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogDestinationType
*/
public CreateFlowLogsRequest withLogDestinationType(String logDestinationType) {
setLogDestinationType(logDestinationType);
return this;
}
/**
*
* The type of destination for the flow log data. *
*
* Default: cloud-watch-logs
*
* Default: cloud-watch-logs
* @see LogDestinationType
*/
public void setLogDestinationType(LogDestinationType logDestinationType) {
withLogDestinationType(logDestinationType);
}
/**
*
* The type of destination for the flow log data. *
*
* Default: cloud-watch-logs
*
* Default: cloud-watch-logs
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogDestinationType
*/
public CreateFlowLogsRequest withLogDestinationType(LogDestinationType logDestinationType) {
this.logDestinationType = logDestinationType.toString();
return this;
}
/**
*
* The destination for the flow log data. The meaning of this parameter depends on the destination type. *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group. For
* example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group.
* For example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
** The destination for the flow log data. The meaning of this parameter depends on the destination type. *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group. For
* example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group.
* For example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
** The destination for the flow log data. The meaning of this parameter depends on the destination type. *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group. For
* example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
*
* If the destination type is cloud-watch-logs
, specify the ARN of a CloudWatch Logs log group.
* For example:
*
* arn:aws:logs:region:account_id:log-group:my_group *
*
* Alternatively, use the LogGroupName
parameter.
*
* If the destination type is s3
, specify the ARN of an S3 bucket. For example:
*
* arn:aws:s3:::my_bucket/my_subfolder/ *
*
* The subfolder is optional. Note that you can't use AWSLogs
as a subfolder name.
*
* If the destination type is kinesis-data-firehose
, specify the ARN of a Kinesis Data Firehose
* delivery stream. For example:
*
* arn:aws:firehose:region:account_id:deliverystream:my_stream *
** 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 Flow log records in * the Amazon VPC User Guide or Transit Gateway Flow Log * records in the Amazon Web Services Transit Gateway Guide. *
*
* 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.
*
* 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.
*/
public void setLogFormat(String logFormat) {
this.logFormat = logFormat;
}
/**
*
* 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 Flow log records in * the Amazon VPC User Guide or Transit Gateway Flow Log * records in the Amazon Web Services Transit Gateway Guide. *
*
* 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.
*
* 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.
*/
public String getLogFormat() {
return this.logFormat;
}
/**
*
* 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 Flow log records in * the Amazon VPC User Guide or Transit Gateway Flow Log * records in the Amazon Web Services Transit Gateway Guide. *
*
* 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.
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFlowLogsRequest withLogFormat(String logFormat) {
setLogFormat(logFormat);
return this;
}
/**
*
* The tags to apply to the flow logs. *
* * @return The tags to apply to the flow logs. */ public java.util.List* The tags to apply to the flow logs. *
* * @param tagSpecifications * The tags to apply to the flow logs. */ public void setTagSpecifications(java.util.Collection* The tags to apply to the flow logs. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if * you want to override the existing values. *
* * @param tagSpecifications * The tags to apply to the flow logs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFlowLogsRequest withTagSpecifications(TagSpecification... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList* The tags to apply to the flow logs. *
* * @param tagSpecifications * The tags to apply to the flow logs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFlowLogsRequest withTagSpecifications(java.util.Collection* 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. *
** 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 *
* * @param maxAggregationInterval * 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. ** 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 */ public void setMaxAggregationInterval(Integer maxAggregationInterval) { this.maxAggregationInterval = maxAggregationInterval; } /** *
* 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. *
** 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 *
* * @return 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. ** 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 */ public Integer getMaxAggregationInterval() { return this.maxAggregationInterval; } /** *
* 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. *
** 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 *
* * @param maxAggregationInterval * 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. ** 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 * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFlowLogsRequest withMaxAggregationInterval(Integer maxAggregationInterval) { setMaxAggregationInterval(maxAggregationInterval); return this; } /** *
* The destination options. *
* * @param destinationOptions * The destination options. */ public void setDestinationOptions(DestinationOptionsRequest destinationOptions) { this.destinationOptions = destinationOptions; } /** ** The destination options. *
* * @return The destination options. */ public DestinationOptionsRequest getDestinationOptions() { return this.destinationOptions; } /** ** The destination options. *
* * @param destinationOptions * The destination options. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFlowLogsRequest withDestinationOptions(DestinationOptionsRequest destinationOptions) { setDestinationOptions(destinationOptions); return this; } /** * This method is intended for internal use only. Returns the marshaled request configured with additional * parameters to enable operation dry-run. */ @Override public Request