startFlowCapture method

Future<StartFlowCaptureResponse> startFlowCapture({
  1. required String firewallArn,
  2. required List<FlowFilter> flowFilters,
  3. String? availabilityZone,
  4. int? minimumFlowAgeInSeconds,
  5. String? vpcEndpointAssociationArn,
  6. String? vpcEndpointId,
})

Begins capturing the flows in a firewall, according to the filters you define. Captures are similar, but not identical to snapshots. Capture operations provide visibility into flows that are not closed and are tracked by a firewall's flow table. Unlike snapshots, captures are a time-boxed view.

A flow is network traffic that is monitored by a firewall, either by stateful or stateless rules. For traffic to be considered part of a flow, it must share Destination, DestinationPort, Direction, Protocol, Source, and SourcePort.

May throw InternalServerError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter firewallArn : The Amazon Resource Name (ARN) of the firewall.

Parameter flowFilters : Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.

Parameter availabilityZone : The ID of the Availability Zone where the firewall is located. For example, us-east-2a.

Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.

Parameter minimumFlowAgeInSeconds : The reqested FlowOperation ignores flows with an age (in seconds) lower than MinimumFlowAgeInSeconds. You provide this for start commands.

Parameter vpcEndpointAssociationArn : The Amazon Resource Name (ARN) of a VPC endpoint association.

Parameter vpcEndpointId : A unique identifier for the primary endpoint associated with a firewall.

Implementation

Future<StartFlowCaptureResponse> startFlowCapture({
  required String firewallArn,
  required List<FlowFilter> flowFilters,
  String? availabilityZone,
  int? minimumFlowAgeInSeconds,
  String? vpcEndpointAssociationArn,
  String? vpcEndpointId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.StartFlowCapture'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FirewallArn': firewallArn,
      'FlowFilters': flowFilters,
      if (availabilityZone != null) 'AvailabilityZone': availabilityZone,
      if (minimumFlowAgeInSeconds != null)
        'MinimumFlowAgeInSeconds': minimumFlowAgeInSeconds,
      if (vpcEndpointAssociationArn != null)
        'VpcEndpointAssociationArn': vpcEndpointAssociationArn,
      if (vpcEndpointId != null) 'VpcEndpointId': vpcEndpointId,
    },
  );

  return StartFlowCaptureResponse.fromJson(jsonResponse.body);
}