AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS WAF V2 PutLoggingConfiguration API operation.

Syntax

Write-WAF2LoggingConfiguration
-LoggingConfiguration_ResourceArn <String>
-LoggingFilter_DefaultBehavior <FilterBehavior>
-LoggingFilter_Filter <Filter[]>
-LoggingConfiguration_LogDestinationConfig <String[]>
-LoggingConfiguration_LogScope <LogScope>
-LoggingConfiguration_LogType <LogType>
-LoggingConfiguration_ManagedByFirewallManager <Boolean>
-LoggingConfiguration_RedactedField <FieldToMatch[]>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonWAFV2Config>

Description

Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided. This operation completely replaces any mutable specifications that you already have for a logging configuration with the ones that you provide to this call. To modify an existing logging configuration, do the following:
  1. Retrieve it by calling GetLoggingConfiguration
  2. Update its settings as needed
  3. Provide the complete logging configuration specification to this call
You can define one logging destination per web ACL. You can access information about the traffic that WAF inspects using the following steps:
  1. Create your logging destination. You can use an Amazon CloudWatch Logs log group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis Data Firehose. The name that you give the destination must start with aws-waf-logs-. Depending on the type of destination, you might need to configure additional settings or permissions. For configuration requirements and pricing information for each destination type, see Logging web ACL traffic in the WAF Developer Guide.
  2. Associate your logging destination to your web ACL using a PutLoggingConfiguration request.
When you successfully enable logging using a PutLoggingConfiguration request, WAF creates an additional role or policy that is required to write logs to the logging destination. For an Amazon CloudWatch Logs log group, WAF creates a resource policy on the log group. For an Amazon S3 bucket, WAF creates a bucket policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked role. For additional information about web ACL logging, see Logging web ACL traffic information in the WAF Developer Guide.

Parameters

-ClientConfig <AmazonWAFV2Config>
Amazon.PowerShell.Cmdlets.WAF2.AmazonWAFV2ClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_LogDestinationConfig <String[]>
The logging destination configuration that you want to associate with the web ACL.You can associate one logging destination to a web ACL.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoggingConfiguration_LogDestinationConfigs
-LoggingConfiguration_LogScope <LogScope>
The owner of the logging configuration, which must be set to CUSTOMER for the configurations that you manage. The log scope SECURITY_LAKE indicates a configuration that is managed through Amazon Security Lake. You can use Security Lake to collect log and event data from various sources for normalization, analysis, and management. For information, see Collecting data from Amazon Web Services services in the Amazon Security Lake user guide.Default: CUSTOMER
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_LogType <LogType>
Used to distinguish between various logging options. Currently, there is one option.Default: WAF_LOGS
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_ManagedByFirewallManager <Boolean>
Indicates whether the logging configuration was created by Firewall Manager, as part of an WAF policy configuration. If true, only Firewall Manager can modify or delete the configuration.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_RedactedField <FieldToMatch[]>
The parts of the request that you want to keep out of the logs.For example, if you redact the SingleHeader field, the HEADER field in the logs will be REDACTED for all rules that use the SingleHeaderFieldToMatch setting. Redaction applies only to the component that's specified in the rule's FieldToMatch setting, so the SingleHeader redaction doesn't apply to rules that use the HeadersFieldToMatch.You can specify only the following fields for redaction: UriPath, QueryString, SingleHeader, and Method.This setting has no impact on request sampling. With request sampling, the only way to exclude fields is by disabling sampling in the web ACL visibility configuration.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoggingConfiguration_RedactedFields
-LoggingConfiguration_ResourceArn <String>
The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-LoggingFilter_DefaultBehavior <FilterBehavior>
Default handling for logs that don't match any of the specified filtering conditions.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoggingConfiguration_LoggingFilter_DefaultBehavior
-LoggingFilter_Filter <Filter[]>
The filters that you want to apply to the logs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoggingConfiguration_LoggingFilter_Filters
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the LoggingConfiguration_ResourceArn parameter. The -PassThru parameter is deprecated, use -Select '^LoggingConfiguration_ResourceArn' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'LoggingConfiguration'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.WAFV2.Model.PutLoggingConfigurationResponse). Specifying the name of a property of type Amazon.WAFV2.Model.PutLoggingConfigurationResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.WAFV2.Model.LoggingConfiguration object. The service call response (type Amazon.WAFV2.Model.PutLoggingConfigurationResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z