fix(cloudformation): read network ACL entry PortRange and RuleNumber with resolveOptionalInt (#6724)

This commit is contained in:
lex00 authored and GitHub committed 2026-10-27 10:26:21 -04:00
1 parent 77f2477641
commit 0c44312101
2 files changed
+24 -6

No files matched your search

@@ -92,14 +92,12 @@ public class Ec2NetworkAclCfnProvisioner implements CfnResourceProvisioner {
private void provisionNetworkAclEntry(StackResource r, JsonNode props, ProvisionContext ctx) {
String aclId = ctx.resolveOptional(props, "NetworkAclId");
String ruleNumberValue = ctx.resolveOptional(props, "RuleNumber");
int ruleNumber = ruleNumberValue != null ? Integer.parseInt(ruleNumberValue) : 100;
Integer ruleNumberValue = ctx.resolveOptionalInt(props, "RuleNumber");
int ruleNumber = ruleNumberValue != null ? ruleNumberValue : 100;
boolean egress = Boolean.parseBoolean(ctx.resolveOptional(props, "Egress"));
JsonNode portRange = props != null && props.hasNonNull("PortRange") ? props.get("PortRange") : null;
String fromValue = ctx.resolveOptional(portRange, "From");
String toValue = ctx.resolveOptional(portRange, "To");
Integer from = fromValue != null ? Integer.valueOf(fromValue) : null;
Integer to = toValue != null ? Integer.valueOf(toValue) : null;
Integer from = ctx.resolveOptionalInt(portRange, "From");
Integer to = ctx.resolveOptionalInt(portRange, "To");
JsonNode icmp = props != null && props.hasNonNull("Icmp") ? props.get("Icmp") : null;
String protocol = ctx.resolveOptional(props, "Protocol");
ec2Service.createNetworkAclEntry(ctx.region(), aclId, ruleNumber,