Skip to content

Commit 076df98

Browse files
committed
bugfix to networking construct
1 parent 45cece8 commit 076df98

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sds_data_manager/constructs/networking_construct.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _create_vpn_gateway(self) -> ec2.CfnVPNGateway:
7070
)
7171

7272
# Attach the VGW to the VPC so decrypted traffic can enter the VPC.
73-
ec2.CfnVPCGatewayAttachment(
73+
attachment = ec2.CfnVPCGatewayAttachment(
7474
self,
7575
"VpnGatewayAttachment",
7676
vpc_id=self.vpc.vpc_id,
@@ -79,12 +79,14 @@ def _create_vpn_gateway(self) -> ec2.CfnVPNGateway:
7979

8080
# Adds VPN route propagation to each public subnet so that regardless of
8181
# which AZ the I-ALiRT EC2 lands in, it can receive traffic from the VPN.
82+
# Must depend on the attachment being complete first.
8283
for i, subnet in enumerate(self.vpc.public_subnets):
83-
ec2.CfnVPNGatewayRoutePropagation(
84+
propagation = ec2.CfnVPNGatewayRoutePropagation(
8485
self,
8586
f"RoutePropagate{i}",
8687
route_table_ids=[subnet.route_table.route_table_id],
8788
vpn_gateway_id=vpn_gateway.ref,
8889
)
90+
propagation.node.add_dependency(attachment)
8991

9092
return vpn_gateway

0 commit comments

Comments
 (0)