title: See all resources in a subnet / See if subnet is in use
body: <p>I am trying to clean up my AWS configuration and I want to know if particular subnets are actually used/have any resources in them.</p>
  
  <p>I'm aware you can filter a list of a particular resource type (e.g. EC2 instances) by subnet id, through the AWS web interface, but I am not yet aware of all of the different resource types that may be used - so I am concerned I may miss something.</p>
  
  <p>I have tried inspecting the subnet via the AWS CLI, but I can't see anything that clearly differentiates subnets that are in use and those that are not:</p>
  
  <pre><code>aws ec2 describe-subnets
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/3219762/list-ip-all-addresses-in-a-subnet">This question</a> deals with enumerating all IP addresses within a particular subnet's CIDR block, but it doesn't reveal how to show only active IP addresses (which I could presumably use to find the attached AWS resources and confirm a subnet is indeed in use).</p>
  
  <p>This seems like it would be a common task, but I can find no AWS documentation or SO posts on how to do this. Perhaps there is something flawed  in my approach.</p>