Skip to main content

logging_configurations

Creates, updates, deletes or gets a logging_configuration resource or lists logging_configurations in a region

Overview

Namelogging_configurations
TypeResource
DescriptionA WAFv2 Logging Configuration Resource Provider
Idaws.wafv2.logging_configurations

Fields

NameDatatypeDescription
resource_arnstringThe Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs.
log_destination_configsarrayThe Amazon Resource Names (ARNs) of the logging destinations that you want to associate with the web ACL.
redacted_fieldsarrayThe parts of the request that you want to keep out of the logs. For example, if you redact the HEADER field, the HEADER field in the firehose will be xxx.
managed_by_firewall_managerbooleanIndicates whether the logging configuration was created by AWS Firewall Manager, as part of an AWS WAF policy configuration. If true, only Firewall Manager can modify or delete the configuration.
logging_filterobjectFiltering that specifies which web requests are kept in the logs and which are dropped. You can filter on the rule action and on the web request labels that were applied by matching rules during web ACL evaluation.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTResourceArn, LogDestinationConfigs, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all logging_configurations in a region.

SELECT
region,
resource_arn,
log_destination_configs,
redacted_fields,
managed_by_firewall_manager,
logging_filter
FROM aws.wafv2.logging_configurations
;

Gets all properties from an individual logging_configuration.

SELECT
region,
resource_arn,
log_destination_configs,
redacted_fields,
managed_by_firewall_manager,
logging_filter
FROM aws.wafv2.logging_configurations
WHERE data__Identifier = '<ResourceArn>';

INSERT example

Use the following StackQL query and manifest file to create a new logging_configuration resource, using stack-deploy.

/*+ create */
INSERT INTO aws.wafv2.logging_configurations (
ResourceArn,
LogDestinationConfigs,
region
)
SELECT
'{{ ResourceArn }}',
'{{ LogDestinationConfigs }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.wafv2.logging_configurations
WHERE data__Identifier = '<ResourceArn>'
AND region = 'us-east-1';

Permissions

To operate on the logging_configurations resource, the following permissions are required:

Create

wafv2:PutLoggingConfiguration,
wafv2:GetLoggingConfiguration,
firehose:ListDeliveryStreams,
iam:CreateServiceLinkedRole,
iam:DescribeOrganization,
logs:CreateLogDelivery,
s3:PutBucketPolicy,
s3:GetBucketPolicy,
logs:PutResourcePolicy,
logs:DescribeResourcePolicies,
logs:DescribeLogGroups

Read

wafv2:GetLoggingConfiguration

Update

wafv2:PutLoggingConfiguration,
wafv2:GetLoggingConfiguration,
firehose:ListDeliveryStreams,
iam:CreateServiceLinkedRole,
iam:DescribeOrganization,
logs:CreateLogDelivery,
s3:PutBucketPolicy,
s3:GetBucketPolicy,
logs:PutResourcePolicy,
logs:DescribeResourcePolicies,
logs:DescribeLogGroups

Delete

wafv2:DeleteLoggingConfiguration,
wafv2:GetLoggingConfiguration,
logs:DeleteLogDelivery

List

wafv2:ListLoggingConfigurations