I'm trying to create WAFv2 WebAcl service using AWS CDK. My programming language is C# (.NET Core). I'm not able to figure out how to set value of CfnWebACL.DefaultActionProperty.Allow or CfnWebACL.DefaultActionProperty.Block property as it is an object type and any value I assign to it result in runtime error.
How can I set value to CfnWebACL.DefaultActionProperty.Allow property in WAFv2 from AWS CDK and .NET core
1.2k views Asked by user2892158 At
3
There are 3 answers
0

and for the pythoneers amongst us:
some_webacl = CfnWebACL(
self,
'some_webacl',
default_action=CfnWebACL.DefaultActionProperty(block={}),
scope='REGIONAL',
visibility_config=CfnWebACL.VisibilityConfigProperty(
cloud_watch_metrics_enabled=True,
metric_name=NAME_PREFIX + 'some_webacl',
sampled_requests_enabled=True
),
description=NAME_PREFIX + 'some_webacl',
rules=[]
)
This model type seems to work for me ^