deleteFirewall method

Future<DeleteFirewallResponse> deleteFirewall({
  1. String? firewallArn,
  2. String? firewallName,
})

Deletes the specified Firewall and its FirewallStatus. This operation requires the firewall's DeleteProtection flag to be FALSE. You can't revert this operation.

You can check whether a firewall is in use by reviewing the route tables for the Availability Zones where you have firewall subnet mappings. Retrieve the subnet mappings by calling DescribeFirewall. You define and update the route tables through Amazon VPC. As needed, update the route tables for the zones to remove the firewall endpoints. When the route tables no longer use the firewall endpoints, you can remove the firewall safely.

To delete a firewall, remove the delete protection if you need to using UpdateFirewallDeleteProtection, then delete the firewall by calling DeleteFirewall.

May throw InternalServerError. May throw InvalidOperationException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedOperationException.

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

You must specify the ARN or the name, and you can specify both.

Parameter firewallName : The descriptive name of the firewall. You can't change the name of a firewall after you create it.

You must specify the ARN or the name, and you can specify both.

Implementation

Future<DeleteFirewallResponse> deleteFirewall({
  String? firewallArn,
  String? firewallName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.DeleteFirewall'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (firewallArn != null) 'FirewallArn': firewallArn,
      if (firewallName != null) 'FirewallName': firewallName,
    },
  );

  return DeleteFirewallResponse.fromJson(jsonResponse.body);
}