@@ -698,21 +698,31 @@ echo "Updating internet gateway route table..."
698698if ! aws ec2 replace-route \
699699 --route-table-id " $IGW_ROUTE_TABLE_ID " \
700700 --destination-cidr-block " $CUSTOMER_SUBNET_CIDR " \
701- --vpc-endpoint-id " $FIREWALL_ENDPOINT " ; then
702- echo " ERROR: Failed to update internet gateway route"
703- cleanup_resources
704- exit 1
701+ --vpc-endpoint-id " $FIREWALL_ENDPOINT " 2> /dev/null; then
702+ if ! aws ec2 create-route \
703+ --route-table-id " $IGW_ROUTE_TABLE_ID " \
704+ --destination-cidr-block " $CUSTOMER_SUBNET_CIDR " \
705+ --vpc-endpoint-id " $FIREWALL_ENDPOINT " ; then
706+ echo " ERROR: Failed to update internet gateway route"
707+ cleanup_resources
708+ exit 1
709+ fi
705710fi
706711
707712# Update the customer subnet route table
708713echo " Updating customer subnet route table..."
709714if ! aws ec2 replace-route \
710715 --route-table-id " $SUBNET_ROUTE_TABLE_ID " \
711716 --destination-cidr-block " 0.0.0.0/0" \
712- --vpc-endpoint-id " $FIREWALL_ENDPOINT " ; then
713- echo " ERROR: Failed to update customer subnet route"
714- cleanup_resources
715- exit 1
717+ --vpc-endpoint-id " $FIREWALL_ENDPOINT " 2> /dev/null; then
718+ if ! aws ec2 create-route \
719+ --route-table-id " $SUBNET_ROUTE_TABLE_ID " \
720+ --destination-cidr-block " 0.0.0.0/0" \
721+ --vpc-endpoint-id " $FIREWALL_ENDPOINT " ; then
722+ echo " ERROR: Failed to update customer subnet route"
723+ cleanup_resources
724+ exit 1
725+ fi
716726fi
717727
718728echo " "
0 commit comments