amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.CreateFlowLogs

Description

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.

Synopsis

Creating a Request

data CreateFlowLogs Source #

See: newCreateFlowLogs smart constructor.

Constructors

CreateFlowLogs' 

Fields

  • clientToken :: Maybe Text

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

  • deliverCrossAccountRole :: Maybe Text

    The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.

  • deliverLogsPermissionArn :: Maybe Text

    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.

  • destinationOptions :: Maybe DestinationOptionsRequest

    The destination options.

  • dryRun :: Maybe Bool

    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.

  • logDestination :: Maybe Text

    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

  • logDestinationType :: Maybe LogDestinationType

    The type of destination for the flow log data.

    Default: cloud-watch-logs

  • logFormat :: Maybe Text

    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.

  • logGroupName :: Maybe Text

    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.

  • maxAggregationInterval :: Maybe Int

    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

  • tagSpecifications :: Maybe [TagSpecification]

    The tags to apply to the flow logs.

  • trafficType :: Maybe TrafficType

    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.

  • resourceIds :: [Text]

    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.

  • resourceType :: FlowLogsResourceType

    The type of resource to monitor.

Instances

Instances details
ToHeaders CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

ToPath CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

ToQuery CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

AWSRequest CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Associated Types

type AWSResponse CreateFlowLogs #

Generic CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Associated Types

type Rep CreateFlowLogs :: Type -> Type #

Read CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Show CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

NFData CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Methods

rnf :: CreateFlowLogs -> () #

Eq CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Hashable CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

type AWSResponse CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

type Rep CreateFlowLogs Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

type Rep CreateFlowLogs = D1 ('MetaData "CreateFlowLogs" "Amazonka.EC2.CreateFlowLogs" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateFlowLogs'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "clientToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "deliverCrossAccountRole") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "deliverLogsPermissionArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "destinationOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DestinationOptionsRequest)) :*: S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "logDestination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "logDestinationType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe LogDestinationType))))) :*: ((S1 ('MetaSel ('Just "logFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "maxAggregationInterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)))) :*: ((S1 ('MetaSel ('Just "tagSpecifications") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [TagSpecification])) :*: S1 ('MetaSel ('Just "trafficType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TrafficType))) :*: (S1 ('MetaSel ('Just "resourceIds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "resourceType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FlowLogsResourceType))))))

newCreateFlowLogs Source #

Create a value of CreateFlowLogs with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateFlowLogs, createFlowLogs_clientToken - Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

CreateFlowLogs, createFlowLogs_deliverCrossAccountRole - The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.

CreateFlowLogs, createFlowLogs_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.

CreateFlowLogs, createFlowLogs_destinationOptions - The destination options.

$sel:dryRun:CreateFlowLogs', createFlowLogs_dryRun - 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.

CreateFlowLogs, createFlowLogs_logDestination - 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

CreateFlowLogs, createFlowLogs_logDestinationType - The type of destination for the flow log data.

Default: cloud-watch-logs

CreateFlowLogs, createFlowLogs_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.

CreateFlowLogs, createFlowLogs_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.

CreateFlowLogs, createFlowLogs_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

CreateFlowLogs, createFlowLogs_tagSpecifications - The tags to apply to the flow logs.

CreateFlowLogs, createFlowLogs_trafficType - 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.

$sel:resourceIds:CreateFlowLogs', createFlowLogs_resourceIds - 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.

CreateFlowLogs, createFlowLogs_resourceType - The type of resource to monitor.

Request Lenses

createFlowLogs_clientToken :: Lens' CreateFlowLogs (Maybe Text) Source #

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

createFlowLogs_deliverCrossAccountRole :: Lens' CreateFlowLogs (Maybe Text) Source #

The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.

createFlowLogs_deliverLogsPermissionArn :: Lens' CreateFlowLogs (Maybe Text) Source #

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.

createFlowLogs_dryRun :: Lens' CreateFlowLogs (Maybe Bool) Source #

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.

createFlowLogs_logDestination :: Lens' CreateFlowLogs (Maybe Text) Source #

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

createFlowLogs_logDestinationType :: Lens' CreateFlowLogs (Maybe LogDestinationType) Source #

The type of destination for the flow log data.

Default: cloud-watch-logs

createFlowLogs_logFormat :: Lens' CreateFlowLogs (Maybe Text) Source #

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.

createFlowLogs_logGroupName :: Lens' CreateFlowLogs (Maybe Text) Source #

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.

createFlowLogs_maxAggregationInterval :: Lens' CreateFlowLogs (Maybe Int) Source #

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

createFlowLogs_trafficType :: Lens' CreateFlowLogs (Maybe TrafficType) Source #

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.

createFlowLogs_resourceIds :: Lens' CreateFlowLogs [Text] Source #

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.

Destructuring the Response

data CreateFlowLogsResponse Source #

See: newCreateFlowLogsResponse smart constructor.

Constructors

CreateFlowLogsResponse' 

Fields

Instances

Instances details
Generic CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Associated Types

type Rep CreateFlowLogsResponse :: Type -> Type #

Read CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Show CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

NFData CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

Methods

rnf :: CreateFlowLogsResponse -> () #

Eq CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

type Rep CreateFlowLogsResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateFlowLogs

type Rep CreateFlowLogsResponse = D1 ('MetaData "CreateFlowLogsResponse" "Amazonka.EC2.CreateFlowLogs" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateFlowLogsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "clientToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "flowLogIds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text]))) :*: (S1 ('MetaSel ('Just "unsuccessful") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [UnsuccessfulItem])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newCreateFlowLogsResponse Source #

Create a value of CreateFlowLogsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateFlowLogs, createFlowLogsResponse_clientToken - Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

$sel:flowLogIds:CreateFlowLogsResponse', createFlowLogsResponse_flowLogIds - The IDs of the flow logs.

$sel:unsuccessful:CreateFlowLogsResponse', createFlowLogsResponse_unsuccessful - Information about the flow logs that could not be created successfully.

$sel:httpStatus:CreateFlowLogsResponse', createFlowLogsResponse_httpStatus - The response's http status code.

Response Lenses

createFlowLogsResponse_clientToken :: Lens' CreateFlowLogsResponse (Maybe Text) Source #

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

createFlowLogsResponse_unsuccessful :: Lens' CreateFlowLogsResponse (Maybe [UnsuccessfulItem]) Source #

Information about the flow logs that could not be created successfully.