Skip to content

Commit f076c1d

Browse files
authored
Merge pull request #32 from citizensadvice/fix-logging
Remove tagging feature, other code improvements
2 parents 0e6d1e3 + c40b005 commit f076c1d

3 files changed

Lines changed: 1 addition & 10 deletions

File tree

ca_cdk_constructs/edge_services/waf_rule_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def ip_rule_property(
148148
scope,
149149
f"{name}IpSetIPV6",
150150
addresses=addresses.get("IPV6", []),
151-
description=f"{name}IpSetIPV4",
151+
description=f"{name}IpSetIPV6",
152152
ip_address_version="IPV6",
153153
scope="CLOUDFRONT",
154154
).attr_arn

ca_cdk_constructs/edge_services/waf_v2_builder.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class WafV2Builder:
1414
:param scope: The scope of the construct, i.e the parent stack or construct.
1515
:param name: The name of the WAF ACL.
1616
:param description: The description of the WAF ACL.
17-
:param tags: The tags of the WAF ACL. {"Component": "WAF"} is added in addition to this.
1817
:param waf_scope: The scope of the WAF ACL. Defaults to CLOUDFRONT.
1918
:param log_group: The CloudWatch log group to use for logging. Log group name MUST start with 'aws-waf-logs-'. If not included logging will be disabled.
2019
:param default_action: The default action of the WAF ACL. Defaults to Allow.
@@ -33,7 +32,6 @@ class WafV2Builder:
3332
self,
3433
name="TestWaf",
3534
description="A dummy WAF for testing",
36-
tags={"Foo": "Bar"},
3735
)
3836
3937
waf_builder.add_ip_rule(
@@ -53,7 +51,6 @@ def __init__(
5351
scope: Construct,
5452
name: str,
5553
description: str,
56-
tags: Optional[dict] = dict(),
5754
waf_scope: Optional[str] = "CLOUDFRONT",
5855
log_group: Optional[cf_logs.LogGroup] = None,
5956
default_action: Optional[waf.CfnWebACL.DefaultActionProperty] = None,
@@ -83,8 +80,6 @@ def __init__(
8380
sampled_requests_enabled=False,
8481
)
8582

86-
self.tags = tags | {"Component": "WAF"}
87-
8883
def add_custom_rule(self, rule: waf.CfnWebACL.RuleProperty) -> None:
8984
"""
9085
Adds a custom rule to the WAFv2 WebACL.
@@ -178,8 +173,6 @@ def build(self) -> waf.CfnWebACL:
178173
visibility_config=self.visibility_config,
179174
rules=self.rules,
180175
)
181-
for key, value in self.tags.items():
182-
Tags.of(web_acl).add(key, value)
183176

184177
if self.log_group:
185178
self.logging_config = waf.CfnLoggingConfiguration(

tests/test_waf_v2_builder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def waf_builder():
1111
Stack(App(), "TestStack"),
1212
name="TestWaf",
1313
description="A dummy WAF for testing",
14-
tags={"Foo": "Bar"},
1514
)
1615
yield waf_builder
1716

@@ -100,7 +99,6 @@ def test_waf_v2_logging_enabled():
10099
stack,
101100
name="TestWaf",
102101
description="A dummy WAF for testing",
103-
tags={"Foo": "Bar"},
104102
log_group=test_log_group,
105103
)
106104
waf = waf_builder.build()

0 commit comments

Comments
 (0)