File tree Expand file tree Collapse file tree
sds_data_manager/constructs Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments