Skip to content

Commit 3f5472e

Browse files
authored
Security groups are now supported for network load balancers (#2853)
1 parent 445e4f1 commit 3f5472e

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/cfnlint/rules/resources/elb/Elb.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,6 @@ def match_resource_properties(self, resource_properties, _, path, cfn):
157157
scenarios = cfn.get_object_without_nested_conditions(resource_properties, path)
158158
for scenario in scenarios:
159159
properties = scenario.get("Object")
160-
if self.get_loadbalancer_type(properties) == "network":
161-
if properties.get("SecurityGroups"):
162-
if scenario.get("Scenario"):
163-
scenario_text = " and ".join(
164-
[
165-
f'when condition "{k}" is {v}'
166-
for (k, v) in scenario.get("Scenario").items()
167-
]
168-
)
169-
message = f'Security groups are not supported for load balancers with type "network" {scenario_text}'
170-
matches.append(RuleMatch(path, message))
171-
else:
172-
path = path + ["SecurityGroups"]
173-
matches.append(
174-
RuleMatch(
175-
path,
176-
'Security groups are not supported for load balancers with type "network"',
177-
)
178-
)
179160

180161
matches.extend(
181162
self.check_alb_subnets(properties, path, scenario.get("Scenario"))

test/unit/rules/resources/elb/test_elb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_file_positive(self):
2525
def test_file_negative(self):
2626
"""Test failure"""
2727
self.helper_file_negative(
28-
"test/fixtures/templates/bad/resources/elb/properties.yaml", 8
28+
"test/fixtures/templates/bad/resources/elb/properties.yaml", 6
2929
)
3030

3131
def test_alb_subnets(self):

0 commit comments

Comments
 (0)