putLoggingConfiguration method
Future<PutLoggingConfigurationResponse>
putLoggingConfiguration({
- required LoggingConfiguration loggingConfiguration,
Enables the specified LoggingConfiguration, to start logging from a
web ACL, according to the configuration provided.
You can access information about all traffic that AWS WAF inspects using the following steps:
-
Create an Amazon Kinesis Data Firehose.
Create the data firehose with a PUT source and in the Region that you are operating. If you are capturing logs for Amazon CloudFront, always create the firehose in US East (N. Virginia).
Give the data firehose a name that starts with the prefix
aws-waf-logs-
. For example,aws-waf-logs-us-east-2-analytics
. -
Associate that firehose to your web ACL using a
PutLoggingConfiguration
request.
PutLoggingConfiguration
request, AWS WAF will create a
service linked role with the necessary permissions to write logs to the
Amazon Kinesis Data Firehose. For more information, see Logging
Web ACL Traffic Information in the AWS WAF Developer Guide.
May throw WAFInternalErrorException. May throw WAFNonexistentItemException. May throw WAFOptimisticLockException. May throw WAFServiceLinkedRoleErrorException. May throw WAFInvalidParameterException. May throw WAFInvalidOperationException. May throw WAFLimitsExceededException.
Parameter loggingConfiguration
:
Implementation
Future<PutLoggingConfigurationResponse> putLoggingConfiguration({
required LoggingConfiguration loggingConfiguration,
}) async {
ArgumentError.checkNotNull(loggingConfiguration, 'loggingConfiguration');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSWAF_20190729.PutLoggingConfiguration'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LoggingConfiguration': loggingConfiguration,
},
);
return PutLoggingConfigurationResponse.fromJson(jsonResponse.body);
}