O=$(aws ec2 create-nat-gateway | perl -pe 's/.*: //g');
while true ; do
C=$(aws ect describe-nat-gateways --nat-gateway-ids "$O" | grep -c available || true);
if [ $C -gt 0 ] ; then
break;
fi
sleep 3;
done
aws ec2 replace-route --route-table-id rtb-000000000 --destination-cidr-block 0.0.0.0/0 --nat-gateway-id "$O";