

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::NetworkFirewall::LoggingConfiguration
<a name="aws-resource-networkfirewall-loggingconfiguration"></a>

Use the logging configuration to define the destinations and logging options for an 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 logging configuration 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. 

## Syntax
<a name="aws-resource-networkfirewall-loggingconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-networkfirewall-loggingconfiguration-syntax.json"></a>

```
{
  "Type" : "AWS::NetworkFirewall::LoggingConfiguration",
  "Properties" : {
      "[EnableMonitoringDashboard](#cfn-networkfirewall-loggingconfiguration-enablemonitoringdashboard)" : Boolean,
      "[FirewallArn](#cfn-networkfirewall-loggingconfiguration-firewallarn)" : String,
      "[FirewallName](#cfn-networkfirewall-loggingconfiguration-firewallname)" : String,
      "[LoggingConfiguration](#cfn-networkfirewall-loggingconfiguration-loggingconfiguration)" : LoggingConfiguration
    }
}
```

### YAML
<a name="aws-resource-networkfirewall-loggingconfiguration-syntax.yaml"></a>

```
Type: AWS::NetworkFirewall::LoggingConfiguration
Properties:
  [EnableMonitoringDashboard](#cfn-networkfirewall-loggingconfiguration-enablemonitoringdashboard): Boolean
  [FirewallArn](#cfn-networkfirewall-loggingconfiguration-firewallarn): String
  [FirewallName](#cfn-networkfirewall-loggingconfiguration-firewallname): String
  [LoggingConfiguration](#cfn-networkfirewall-loggingconfiguration-loggingconfiguration): 
    LoggingConfiguration
```

## Properties
<a name="aws-resource-networkfirewall-loggingconfiguration-properties"></a>

`EnableMonitoringDashboard`  <a name="cfn-networkfirewall-loggingconfiguration-enablemonitoringdashboard"></a>
Property description not available.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`FirewallArn`  <a name="cfn-networkfirewall-loggingconfiguration-firewallarn"></a>
The Amazon Resource Name (ARN) of the firewallthat the logging configuration is associated with. You can't change the firewall specification after you create the logging configuration.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^arn:aws.*$`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`FirewallName`  <a name="cfn-networkfirewall-loggingconfiguration-firewallname"></a>
The name of the firewall that the logging configuration is associated with. You can't change the firewall specification after you create the logging configuration.  
*Required*: No  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9-]+$`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`LoggingConfiguration`  <a name="cfn-networkfirewall-loggingconfiguration-loggingconfiguration"></a>
Defines how AWS Network Firewall performs logging for a firewall.   
*Required*: Yes  
*Type*: [LoggingConfiguration](aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-networkfirewall-loggingconfiguration-return-values"></a>

### Ref
<a name="aws-resource-networkfirewall-loggingconfiguration-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the Amazon Resource Name (ARN) of the firewall that the logging configuration is associated with. For example: 

 `{ "Ref": "arn:aws:network-firewall:us-east-1:012345678901:firewall/myFirewallName" }` 

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

## Examples
<a name="aws-resource-networkfirewall-loggingconfiguration--examples"></a>



**Topics**
+ [Create a logging configuration for CloudWatch Logs and Kinesis Data Firehose](#aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_and_Kinesis_Data_Firehose)
+ [Create a logging configuration for Amazon S3](#aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_Amazon_S3)

### Create a logging configuration for CloudWatch Logs and Kinesis Data Firehose
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_and_Kinesis_Data_Firehose"></a>

The following shows example logging configuration specifications for alert logs that go to an Amazon CloudWatch Logs log group and flow logs that go to an Amazon Kinesis Data Firehose delivery stream. 

#### JSON
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_and_Kinesis_Data_Firehose--json"></a>

```
"SampleLoggingConfiguration": {
    "Type": "AWS::NetworkFirewall::LoggingConfiguration",
    "Properties": {
        "FirewallArn": {
            "Ref": "SampleFirewallArn"
        },
        "LoggingConfiguration": {
            "LogDestinationConfigs": [
                {
                    "LogType": "ALERT",
                    "LogDestinationType": "CloudWatchLogs",
                    "LogDestination": {
                        "logGroup": "SampleLogGroup"
                    }
                },
                {
                    "LogType": "FLOW",
                    "LogDestinationType": "KinesisDataFirehose",
                    "LogDestination": {
                        "deliveryStream": "SampleStream"
                    }
                }
            ]
        }
    }
}
```

#### YAML
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_and_Kinesis_Data_Firehose--yaml"></a>

```
SampleLoggingConfiguration:
  Type: 'AWS::NetworkFirewall::LoggingConfiguration'
  Properties:
    FirewallArn: !Ref SampleFirewallArn
    LoggingConfiguration:
      LogDestinationConfigs:
        - LogType: ALERT
          LogDestinationType: CloudWatchLogs
          LogDestination:
            logGroup: SampleLogGroup
        - LogType: FLOW
          LogDestinationType: KinesisDataFirehose
          LogDestination:
            deliveryStream: SampleStream
```

### Create a logging configuration for Amazon S3
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_Amazon_S3"></a>

The following shows example logging configuration specifications for flow logs that go to an Amazon S3 bucket. 

#### JSON
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_Amazon_S3--json"></a>

```
"SampleLoggingConfiguration": {
    "Type": "AWS::NetworkFirewall::LoggingConfiguration",
    "Properties": {
        "FirewallArn": {
            "Ref": "SampleFirewallArn"
        },
        "LoggingConfiguration": {
            "LogDestinationConfigs": [
                {
                    "LogType": "FLOW",
                    "LogDestinationType": "S3",
                    "LogDestination": {
                        "bucketName": "sample-bucket-name",
                        "prefix": "sample/s3/prefix"
                    }
                }
            ]
        }
    }
}
```

#### YAML
<a name="aws-resource-networkfirewall-loggingconfiguration--examples--Create_a_logging_configuration_for_Amazon_S3--yaml"></a>

```
SampleLoggingConfiguration:
  Type: 'AWS::NetworkFirewall::LoggingConfiguration'
  Properties:
    FirewallArn: !Ref SampleFirewallArn
    LoggingConfiguration:
      LogDestinationConfigs:
        - LogType: FLOW
          LogDestinationType: S3
          LogDestination:
            bucketName: sample-bucket-name
            prefix: sample/s3/prefix
```

# AWS::NetworkFirewall::LoggingConfiguration LogDestinationConfig
<a name="aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig"></a>

Defines where AWS Network Firewall sends logs for the firewall for one log type. This is used in logging configuration. You can send each type of log to an Amazon S3 bucket, a CloudWatch log group, or a Kinesis Data Firehose delivery stream.

Network Firewall generates logs for stateful rule groups. You can save alert and flow log types. The stateful rules engine records flow logs for all network traffic that it receives. It records alert logs for traffic that matches stateful rules that have the rule action set to `DROP` or `ALERT`. 

## Syntax
<a name="aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig-syntax.json"></a>

```
{
  "[LogDestination](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestination)" : {Key: Value, ...},
  "[LogDestinationType](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestinationtype)" : String,
  "[LogType](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logtype)" : String
}
```

### YAML
<a name="aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig-syntax.yaml"></a>

```
  [LogDestination](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestination): 
    Key: Value
  [LogDestinationType](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestinationtype): String
  [LogType](#cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logtype): String
```

## Properties
<a name="aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig-properties"></a>

`LogDestination`  <a name="cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestination"></a>
The named location for the logs, provided in a key:value mapping that is specific to the chosen destination type.   
+ For an Amazon S3 bucket, provide the name of the bucket, with key `bucketName`, and optionally provide a prefix, with key `prefix`. 

  The following example specifies an Amazon S3 bucket named `DOC-EXAMPLE-BUCKET` and the prefix `alerts`: 

   `"LogDestination": { "bucketName": "DOC-EXAMPLE-BUCKET", "prefix": "alerts" }` 
+ For a CloudWatch log group, provide the name of the CloudWatch log group, with key `logGroup`. The following example specifies a log group named `alert-log-group`: 

   `"LogDestination": { "logGroup": "alert-log-group" }` 
+ For a Firehose delivery stream, provide the name of the delivery stream, with key `deliveryStream`. The following example specifies a delivery stream named `alert-delivery-stream`: 

   `"LogDestination": { "deliveryStream": "alert-delivery-stream" }` 
*Required*: Yes  
*Type*: Object of String  
*Pattern*: `^[0-9A-Za-z.\-_@\/]+$`  
*Minimum*: `1`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LogDestinationType`  <a name="cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logdestinationtype"></a>
The type of storage destination to send these logs to. You can send logs to an Amazon S3 bucket, a CloudWatch log group, or a Firehose delivery stream.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `S3 | CloudWatchLogs | KinesisDataFirehose`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LogType`  <a name="cfn-networkfirewall-loggingconfiguration-logdestinationconfig-logtype"></a>
The type of log to record. You can record the following types of logs from your Network Firewall stateful engine.  
+ `ALERT` - Logs for traffic that matches your stateful rules and that have an action that sends an alert. A stateful rule sends alerts for the rule actions DROP, ALERT, and REJECT. For more information, see the `StatefulRule` property. 
+ `FLOW` - Standard network traffic flow logs. The stateful rules engine records flow logs for all network traffic that it receives. Each flow log record captures the network flow for a specific standard stateless rule group.
+ `TLS` - Logs for events that are related to TLS inspection. For more information, see [Inspecting SSL/TLS traffic with TLS inspection configurations](https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection-configurations.html) in the *Network Firewall Developer Guide*.
*Required*: Yes  
*Type*: String  
*Allowed values*: `ALERT | FLOW | TLS`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::NetworkFirewall::LoggingConfiguration LoggingConfiguration
<a name="aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration"></a>

Defines how AWS Network Firewall performs logging for a firewall. 

## Syntax
<a name="aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration-syntax.json"></a>

```
{
  "[LogDestinationConfigs](#cfn-networkfirewall-loggingconfiguration-loggingconfiguration-logdestinationconfigs)" : [ LogDestinationConfig, ... ]
}
```

### YAML
<a name="aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration-syntax.yaml"></a>

```
  [LogDestinationConfigs](#cfn-networkfirewall-loggingconfiguration-loggingconfiguration-logdestinationconfigs): 
    - LogDestinationConfig
```

## Properties
<a name="aws-properties-networkfirewall-loggingconfiguration-loggingconfiguration-properties"></a>

`LogDestinationConfigs`  <a name="cfn-networkfirewall-loggingconfiguration-loggingconfiguration-logdestinationconfigs"></a>
Defines the logging destinations for the logs for a firewall. Network Firewall generates logs for stateful rule groups.   
*Required*: Yes  
*Type*: Array of [LogDestinationConfig](aws-properties-networkfirewall-loggingconfiguration-logdestinationconfig.md)  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)