Class CfnLoggingConfigurationPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
As part of the association, you can specify parts of the standard logging fields to keep out of the logs and you can specify filters so that you log only a subset of the logging records.
If you configure data protection for the web ACL, the protection applies to the data that AWS WAF sends to the logs.
You can define one logging destination per web ACL.
You can access information about the traffic that AWS WAF inspects using the following steps:
- 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 AWS WAF Developer Guide .
- Associate your logging destination to your web ACL using a
PutLoggingConfigurationrequest.
When you successfully enable logging using a PutLoggingConfiguration request, AWS WAF creates an additional role or policy that is required to write logs to the logging destination. For an Amazon CloudWatch Logs log group, AWS WAF creates a resource policy on the log group. For an Amazon S3 bucket, AWS WAF creates a bucket policy. For an Amazon Kinesis Data Firehose, AWS WAF creates a service-linked role.
For additional information about web ACL logging, see Logging web ACL traffic information in the AWS WAF Developer Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.wafv2.*;
import software.amazon.awscdk.*;
Object jsonBody;
Object loggingFilter;
IMergeStrategy mergeStrategy;
Object method;
Object queryString;
Object singleHeader;
Object uriPath;
CfnLoggingConfigurationPropsMixin cfnLoggingConfigurationPropsMixin = CfnLoggingConfigurationPropsMixin.Builder.create(CfnLoggingConfigurationMixinProps.builder()
.logDestinationConfigs(List.of("logDestinationConfigs"))
.loggingFilter(loggingFilter)
.redactedFields(List.of(FieldToMatchProperty.builder()
.jsonBody(jsonBody)
.method(method)
.queryString(queryString)
.singleHeader(singleHeader)
.uriPath(uriPath)
.build()))
.resourceArn("resourceArn")
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA single action condition for a condition in a logging filter.static final classA fluent builder forCfnLoggingConfigurationPropsMixin.static interfaceA single match condition for a log filter.static interfaceThe parts of the request that you want to keep out of the logs.static interfaceA single logging filter, used inLoggingFilter.static interfaceA single label name condition for a condition in a logging filter.static interfaceFiltering that specifies which web requests are kept in the logs and which are dropped, defined for a web ACL'sLoggingConfiguration.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::WAFv2::LoggingConfiguration.CfnLoggingConfigurationPropsMixin(CfnLoggingConfigurationMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::WAFv2::LoggingConfiguration.protectedCfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnLoggingConfigurationMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnLoggingConfigurationPropsMixin
protected CfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLoggingConfigurationPropsMixin
protected CfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLoggingConfigurationPropsMixin
@Stability(Stable) public CfnLoggingConfigurationPropsMixin(@NotNull CfnLoggingConfigurationMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::WAFv2::LoggingConfiguration.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnLoggingConfigurationPropsMixin
@Stability(Stable) public CfnLoggingConfigurationPropsMixin(@NotNull CfnLoggingConfigurationMixinProps props) Create a mixin to apply properties toAWS::WAFv2::LoggingConfiguration.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-