firewalls
Creates, updates, deletes, gets or lists a firewalls resource.
Overview
| Name | firewalls |
| Type | Resource |
| Id | aws.network_firewall.firewalls |
Fields
The following fields are returned by SELECT queries:
- describe_firewall
- list_firewalls
| Name | Datatype | Description |
|---|---|---|
firewall | object | A firewall defines the behavior of a firewall, the main VPC where the firewall is used, the Availability Zones where the firewall can be used, and one subnet to use for a firewall endpoint within each of the Availability Zones. The Availability Zones are defined implicitly in the subnet specifications. In addition to the firewall endpoints that you define in this Firewall specification, you can create firewall endpoints in VpcEndpointAssociation resources for any VPC, in any Availability Zone where the firewall is already in use. The status of the firewall, for example whether it's ready to filter network traffic, is provided in the corresponding FirewallStatus. You can retrieve both the firewall and firewall status by calling DescribeFirewall. |
firewall_status | object | Detailed information about the current status of a Firewall. You can retrieve this for a firewall by calling DescribeFirewall and providing the firewall name and ARN. The firewall status indicates a combined status. It indicates whether all subnets are up-to-date with the latest firewall configurations, which is based on the sync states config values, and also whether all subnets have their endpoints fully enabled, based on their sync states attachment values. |
update_token | string | An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request. To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it. To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall hasn't changed since you last retrieved it. If it has changed, the operation fails with an InvalidTokenException. If this happens, retrieve the firewall again to get a current copy of it with a new token. Reapply your changes as needed, then try the operation again using the new token. (pattern: <code>^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$</code>) |
| Name | Datatype | Description |
|---|---|---|
firewall_arn | string | The Amazon Resource Name (ARN) of the firewall. (pattern: <code>^arn:aws.*</code>) |
firewall_name | string | The descriptive name of the firewall. You can't change the name of a firewall after you create it. (pattern: <code>^[a-zA-Z0-9-]+$</code>) |
transit_gateway_attachment_id | string | The unique identifier of the transit gateway attachment associated with this firewall. This field is only present for transit gateway-attached firewalls. (pattern: <code>^tgw-attach-[0-9a-z]+$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_firewall | select | region | Returns the data objects for the specified firewall. | |
list_firewalls | select | region | Retrieves the metadata for the firewalls that you have defined. If you provide VPC identifiers in your request, this returns only the firewalls for those VPCs. Depending on your setting for max results and the number of firewalls, a single call might not return the full list. | |
create_firewall | insert | region, FirewallName, FirewallPolicyArn | Creates an Network Firewall Firewall and accompanying FirewallStatus for a VPC. The firewall defines the configuration settings for an Network Firewall firewall. The settings that you can define at creation include the firewall policy, the subnets in your VPC to use for the firewall endpoints, and any tags that are attached to the firewall Amazon Web Services resource. After you create a firewall, you can provide additional settings, like the logging configuration. To update the settings for a firewall, you use the operations that apply to the settings themselves, for example UpdateLoggingConfiguration, AssociateSubnets, and UpdateFirewallDeleteProtection. To manage a firewall's tags, use the standard Amazon Web Services resource tagging operations, ListTagsForResource, TagResource, and UntagResource. To retrieve information about firewalls, use ListFirewalls and DescribeFirewall. To generate a report on the last 30 days of traffic monitored by a firewall, use StartAnalysisReport. | |
update_firewall_delete_protection | update | region, DeleteProtection | Modifies the flag, DeleteProtection, which indicates whether it is possible to delete the firewall. If the flag is set to TRUE, the firewall is protected against deletion. This setting helps protect against accidentally deleting a firewall that's in use. | |
update_firewall_analysis_settings | update | region | Enables specific types of firewall analysis on a specific firewall you define. | |
delete_firewall | delete | region | 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. | |
start_flow_capture | exec | region, FirewallArn, FlowFilters | 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. To avoid encountering operation limits, you should avoid starting captures with broad filters, like wide IP ranges. Instead, we recommend you define more specific criteria with FlowFilters, like narrow IP ranges, ports, or protocols. | |
start_flow_flush | exec | region, FirewallArn, FlowFilters | Begins the flushing of traffic from the firewall, according to the filters you define. When the operation starts, impacted flows are temporarily marked as timed out before the Suricata engine prunes, or flushes, the flows from the firewall table. While the flush completes, impacted flows are processed as midstream traffic. This may result in a temporary increase in midstream traffic metrics. We recommend that you double check your stream exception policy before you perform a flush operation. | |
update_firewall_description | exec | region | Modifies the description for the specified firewall. Use the description to help you identify the firewall when you're working with it. | |
update_firewall_encryption_configuration | exec | region | A complex type that contains settings for encryption of your firewall resources. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_firewall
- list_firewalls
Returns the data objects for the specified firewall.
SELECT
firewall,
firewall_status,
update_token
FROM aws.network_firewall.firewalls
WHERE region = '{{ region }}' -- required
;
Retrieves the metadata for the firewalls that you have defined. If you provide VPC identifiers in your request, this returns only the firewalls for those VPCs. Depending on your setting for max results and the number of firewalls, a single call might not return the full list.
SELECT
firewall_arn,
firewall_name,
transit_gateway_attachment_id
FROM aws.network_firewall.firewalls
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_firewall
- Manifest
Creates an Network Firewall Firewall and accompanying FirewallStatus for a VPC. The firewall defines the configuration settings for an Network Firewall firewall. The settings that you can define at creation include the firewall policy, the subnets in your VPC to use for the firewall endpoints, and any tags that are attached to the firewall Amazon Web Services resource. After you create a firewall, you can provide additional settings, like the logging configuration. To update the settings for a firewall, you use the operations that apply to the settings themselves, for example UpdateLoggingConfiguration, AssociateSubnets, and UpdateFirewallDeleteProtection. To manage a firewall's tags, use the standard Amazon Web Services resource tagging operations, ListTagsForResource, TagResource, and UntagResource. To retrieve information about firewalls, use ListFirewalls and DescribeFirewall. To generate a report on the last 30 days of traffic monitored by a firewall, use StartAnalysisReport.
INSERT INTO aws.network_firewall.firewalls (
FirewallName,
FirewallPolicyArn,
VpcId,
SubnetMappings,
DeleteProtection,
SubnetChangeProtection,
FirewallPolicyChangeProtection,
Description,
Tags,
EncryptionConfiguration,
EnabledAnalysisTypes,
TransitGatewayId,
AvailabilityZoneMappings,
AvailabilityZoneChangeProtection,
NatGatewayMappings,
ProxySettings,
NoSourcePreservation,
VpcEndpoint,
region
)
SELECT
'{{ FirewallName }}' /* required */,
'{{ FirewallPolicyArn }}' /* required */,
'{{ VpcId }}',
'{{ SubnetMappings }}',
{{ DeleteProtection }},
{{ SubnetChangeProtection }},
{{ FirewallPolicyChangeProtection }},
'{{ Description }}',
'{{ Tags }}',
'{{ EncryptionConfiguration }}',
'{{ EnabledAnalysisTypes }}',
'{{ TransitGatewayId }}',
'{{ AvailabilityZoneMappings }}',
{{ AvailabilityZoneChangeProtection }},
'{{ NatGatewayMappings }}',
'{{ ProxySettings }}',
{{ NoSourcePreservation }},
'{{ VpcEndpoint }}',
'{{ region }}'
RETURNING
firewall,
firewall_status
;
# Description fields are for documentation purposes
- name: firewalls
props:
- name: region
value: "{{ region }}"
description: Required parameter for the firewalls resource.
- name: FirewallName
value: "{{ FirewallName }}"
description: |
The descriptive name of the firewall. You can't change the name of a firewall after you create it.
- name: FirewallPolicyArn
value: "{{ FirewallPolicyArn }}"
description: |
The Amazon Resource Name (ARN) of the FirewallPolicy that you want to use for the firewall.
- name: VpcId
value: "{{ VpcId }}"
description: |
The unique identifier of the VPC where Network Firewall should create the firewall. You can't change this setting after you create the firewall.
- name: SubnetMappings
description: |
The public subnets to use for your Network Firewall firewalls. Each subnet must belong to a different Availability Zone in the VPC. Network Firewall creates a firewall endpoint in each subnet.
value:
- SubnetId: "{{ SubnetId }}"
IPAddressType: "{{ IPAddressType }}"
- name: DeleteProtection
value: {{ DeleteProtection }}
description: |
A flag indicating whether it is possible to delete the firewall. A setting of TRUE indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to TRUE.
- name: SubnetChangeProtection
value: {{ SubnetChangeProtection }}
description: |
A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to TRUE.
- name: FirewallPolicyChangeProtection
value: {{ FirewallPolicyChangeProtection }}
description: |
A setting indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. When you create a firewall, the operation initializes this setting to TRUE.
- name: Description
value: "{{ Description }}"
description: |
A description of the firewall.
- name: Tags
description: |
The key:value pairs to associate with the resource.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: EncryptionConfiguration
description: |
A complex type that contains settings for encryption of your firewall resources.
value:
KeyId: "{{ KeyId }}"
Type: "{{ Type }}"
- name: EnabledAnalysisTypes
value:
- "{{ EnabledAnalysisTypes }}"
description: |
An optional setting indicating the specific traffic analysis types to enable on the firewall.
- name: TransitGatewayId
value: "{{ TransitGatewayId }}"
description: |
Required when creating a transit gateway-attached firewall. The unique identifier of the transit gateway to attach to this firewall. You can provide either a transit gateway from your account or one that has been shared with you through Resource Access Manager. After creating the firewall, you cannot change the transit gateway association. To use a different transit gateway, you must create a new firewall. For information about creating firewalls, see CreateFirewall. For specific guidance about transit gateway-attached firewalls, see Considerations for transit gateway-attached firewalls in the Network Firewall Developer Guide.
- name: AvailabilityZoneMappings
description: |
Required. The Availability Zones where you want to create firewall endpoints for a transit gateway-attached firewall. You must specify at least one Availability Zone. Consider enabling the firewall in every Availability Zone where you have workloads to maintain Availability Zone isolation. You can modify Availability Zones later using AssociateAvailabilityZones or DisassociateAvailabilityZones, but this may briefly disrupt traffic. The AvailabilityZoneChangeProtection setting controls whether you can make these modifications.
value:
- AvailabilityZone: "{{ AvailabilityZone }}"
- name: AvailabilityZoneChangeProtection
value: {{ AvailabilityZoneChangeProtection }}
description: |
Optional. A setting indicating whether the firewall is protected against changes to its Availability Zone configuration. When set to TRUE, you cannot add or remove Availability Zones without first disabling this protection using UpdateAvailabilityZoneChangeProtection. Default value: FALSE
- name: NatGatewayMappings
description: |
The NAT gateways that the firewall uses to proxy traffic when NoSourcePreservation is TRUE. Network Firewall attaches the firewall to each NAT gateway that you specify, so that egress traffic is proxied through the NAT gateway.
value:
- NatGatewayId: "{{ NatGatewayId }}"
- name: ProxySettings
description: |
The listener configuration for a proxy mode firewall, used when NoSourcePreservation is TRUE. This specifies the ports and protocols on which the firewall's proxy listens for traffic.
value:
ListenerProperties:
- Port: {{ Port }}
Type: "{{ Type }}"
- name: NoSourcePreservation
value: {{ NoSourcePreservation }}
description: |
Optional. Indicates whether the firewall operates in proxy mode, in which the source IP address of the traffic is not preserved. When set to TRUE, the firewall proxies traffic through a NAT gateway and the traffic reaching the destination uses the NAT gateway's IP address as the source. When you set this to TRUE, you must specify NatGatewayMappings and VpcEndpoint instead of a top-level VpcId and SubnetMappings. You can't change this setting after you create the firewall. Default value: FALSE
- name: VpcEndpoint
description: |
The VPC and subnets for the firewall endpoint, used when NoSourcePreservation is TRUE. Network Firewall creates the firewall endpoint in the subnets that you specify here. For proxy mode firewalls, provide the firewall's VPC and endpoint subnets through this parameter instead of the top-level VpcId and SubnetMappings.
value:
VpcId: "{{ VpcId }}"
SubnetMappings:
- SubnetId: "{{ SubnetId }}"
IPAddressType: "{{ IPAddressType }}"
UPDATE examples
- update_firewall_delete_protection
- update_firewall_analysis_settings
Modifies the flag, DeleteProtection, which indicates whether it is possible to delete the firewall. If the flag is set to TRUE, the firewall is protected against deletion. This setting helps protect against accidentally deleting a firewall that's in use.
UPDATE aws.network_firewall.firewalls
SET
UpdateToken = '{{ UpdateToken }}',
FirewallArn = '{{ FirewallArn }}',
FirewallName = '{{ FirewallName }}',
DeleteProtection = {{ DeleteProtection }}
WHERE
region = '{{ region }}' --required
AND DeleteProtection = {{ DeleteProtection }} --required
RETURNING
delete_protection,
firewall_arn,
firewall_name,
update_token;
Enables specific types of firewall analysis on a specific firewall you define.
UPDATE aws.network_firewall.firewalls
SET
EnabledAnalysisTypes = '{{ EnabledAnalysisTypes }}',
FirewallArn = '{{ FirewallArn }}',
FirewallName = '{{ FirewallName }}',
UpdateToken = '{{ UpdateToken }}'
WHERE
region = '{{ region }}' --required
RETURNING
enabled_analysis_types,
firewall_arn,
firewall_name,
update_token;
DELETE examples
- delete_firewall
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.
DELETE FROM aws.network_firewall.firewalls
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- start_flow_capture
- start_flow_flush
- update_firewall_description
- update_firewall_encryption_configuration
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. To avoid encountering operation limits, you should avoid starting captures with broad filters, like wide IP ranges. Instead, we recommend you define more specific criteria with FlowFilters, like narrow IP ranges, ports, or protocols.
EXEC aws.network_firewall.firewalls.start_flow_capture
@region='{{ region }}' --required
@@json=
'{
"FirewallArn": "{{ FirewallArn }}",
"AvailabilityZone": "{{ AvailabilityZone }}",
"VpcEndpointAssociationArn": "{{ VpcEndpointAssociationArn }}",
"VpcEndpointId": "{{ VpcEndpointId }}",
"MinimumFlowAgeInSeconds": {{ MinimumFlowAgeInSeconds }},
"FlowFilters": "{{ FlowFilters }}"
}'
;
Begins the flushing of traffic from the firewall, according to the filters you define. When the operation starts, impacted flows are temporarily marked as timed out before the Suricata engine prunes, or flushes, the flows from the firewall table. While the flush completes, impacted flows are processed as midstream traffic. This may result in a temporary increase in midstream traffic metrics. We recommend that you double check your stream exception policy before you perform a flush operation.
EXEC aws.network_firewall.firewalls.start_flow_flush
@region='{{ region }}' --required
@@json=
'{
"FirewallArn": "{{ FirewallArn }}",
"AvailabilityZone": "{{ AvailabilityZone }}",
"VpcEndpointAssociationArn": "{{ VpcEndpointAssociationArn }}",
"VpcEndpointId": "{{ VpcEndpointId }}",
"MinimumFlowAgeInSeconds": {{ MinimumFlowAgeInSeconds }},
"FlowFilters": "{{ FlowFilters }}"
}'
;
Modifies the description for the specified firewall. Use the description to help you identify the firewall when you're working with it.
EXEC aws.network_firewall.firewalls.update_firewall_description
@region='{{ region }}' --required
@@json=
'{
"UpdateToken": "{{ UpdateToken }}",
"FirewallArn": "{{ FirewallArn }}",
"FirewallName": "{{ FirewallName }}",
"Description": "{{ Description }}"
}'
;
A complex type that contains settings for encryption of your firewall resources.
EXEC aws.network_firewall.firewalls.update_firewall_encryption_configuration
@region='{{ region }}' --required
@@json=
'{
"UpdateToken": "{{ UpdateToken }}",
"FirewallArn": "{{ FirewallArn }}",
"FirewallName": "{{ FirewallName }}",
"EncryptionConfiguration": "{{ EncryptionConfiguration }}"
}'
;