You can use the wait command while waiting for the gateway to be ready: ``` # Wait for the gateway to be available. aws ec2 wait nat-gateway-available --nat-gateway-ids $NAT_GW_ID ```