fix(cloudformation): preserve subnet public IP setting (#2031)

This commit is contained in:
Aniket Shukla authored and GitHub committed 2026-07-29 22:27:15 -05:00
1 parent c0522593e5
commit b62d1e762e
2 files changed
+9 -1

No files matched your search

@@ -587,7 +587,11 @@ public class CloudFormationResourceProvisioner {
String vpcId = resolveOptional(props, "VpcId", engine);
String cidr = resolveOptional(props, "CidrBlock", engine);
String az = resolveOptional(props, "AvailabilityZone", engine);
String mapPublicIpOnLaunch = resolveOptional(props, "MapPublicIpOnLaunch", engine);
var subnet = ec2Service.createSubnet(region, vpcId, cidr, az);
if (mapPublicIpOnLaunch != null) {
ec2Service.modifySubnetAttribute(region, subnet.getSubnetId(), "mapPublicIpOnLaunch", mapPublicIpOnLaunch);
}
r.setPhysicalId(subnet.getSubnetId());
r.getAttributes().put("SubnetId", subnet.getSubnetId());
r.getAttributes().put("VpcId", subnet.getVpcId());