A total of two subnets is required. One is open to the public, while the other is closed to the public.
Subnetwork open to the general public
The public IP address of a public subnet can be enabled. A NAT gateway and a route table should be included:
In the private subnet, your private instance should be. A route table for the subnet is required: