AWS Network Firewall Logging Configuration

This page shows how to write Terraform and CloudFormation for Network Firewall Logging Configuration and write them securely.

aws_networkfirewall_logging_configuration (Terraform)

The Logging Configuration in Network Firewall can be configured in Terraform with the resource name aws_networkfirewall_logging_configuration. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

logging.tf#L8
resource "aws_networkfirewall_logging_configuration" "firewall" {
  firewall_arn = aws_networkfirewall_firewall.example.arn
  logging_configuration {
    log_destination_config {
      log_destination = {
        logGroup = aws_cloudwatch_log_group.firewall.name
firewall.tf#L64
resource "aws_networkfirewall_logging_configuration" "this" {
  count        = var.firewall_enable_logging ? 1 : 0
  firewall_arn = aws_networkfirewall_firewall.this.arn
  logging_configuration {
    log_destination_config {
      log_destination = {
10_111_0_0_fw.tf#L165
resource "aws_networkfirewall_logging_configuration" "default" {
  firewall_arn = aws_networkfirewall_firewall.default.arn
  logging_configuration {
    log_destination_config {
      log_destination = {
        logGroup = aws_cloudwatch_log_group.fw.name
main.tf#L40
resource "aws_networkfirewall_logging_configuration" "firewall_flow_log" {
  firewall_arn = aws_networkfirewall_firewall.firewall.arn
  logging_configuration {
    log_destination_config {
      log_destination = {
        logGroup = aws_cloudwatch_log_group.firewall_flow_log.name
main.tf#L40
resource "aws_networkfirewall_logging_configuration" "firewall_flow_log" {
  firewall_arn = aws_networkfirewall_firewall.firewall.arn
  logging_configuration {
    log_destination_config {
      log_destination = {
        logGroup = aws_cloudwatch_log_group.firewall_flow_log.name

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an AWS Network Firewall Logging Configuration Resource

AWS::NetworkFirewall::LoggingConfiguration (CloudFormation)

The LoggingConfiguration in NetworkFirewall can be configured in CloudFormation with the resource name AWS::NetworkFirewall::LoggingConfiguration. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

Use the AWS::NetworkFirewall::LoggingConfiguration to define the destinations and logging options for an AWS::NetworkFirewall::Firewall. You must change the logging configuration by changing one LogDestinationConfig setting at a time in your LogDestinationConfigs. You can make only one of the following changes to your AWS::NetworkFirewall::LoggingConfiguration resource: + Create a new log destination object by adding a single LogDestinationConfig array element to LogDestinationConfigs.

  • Delete a log destination object by removing a single LogDestinationConfig array element from LogDestinationConfigs.

  • Change the LogDestination setting in a single LogDestinationConfig array element.

You can't change the LogDestinationType or LogType in a LogDestinationConfig. To change these settings, delete the existing LogDestinationConfig object and create a new one, in two separate modifications.

Frequently asked questions

What is AWS Network Firewall Logging Configuration?

AWS Network Firewall Logging Configuration is a resource for Network Firewall of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Network Firewall Logging Configuration?

For Terraform, the toddlers/aws-network-firewall-workflow, pete911/eks-cluster and ericdahl/tf-vpc-sandbox source code examples are useful. See the Terraform Example section for further details.