Is there a way to find how many total ip addresses that an AWS subnet can hold?
If my subnet CIDR is a.b.c.d/n, then the total ips allowed in this subnet - are they decided by a, b, c & d as well?
AWS docs show what the reserved IP's in each subnet are: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html
The gist of it is, the first 4 IP's and the last IP of the subnet are off limits if your subnet starts with the same IP as the VPC. It's probably a good rule of thumb to avoid assuming these IPs are going to be available in any subnet even though potentially the second subnet address reserved for DNS could be available for consumption in another subnet. A better rule of thumb to avoid under-sizing subnets in AWS. Like, never plan on using a subnet smaller than /24. You need them for auto-scaling groups, NAT gateways, VPN's, and networking hooks into other apps like DynamoDB or Lambda.