title: How can I create an AWS AMI from a running instance but remove costly data
body: <p>I have an EC2 instance that houses an application and a database.  The current instance is running in a production environment with a populated database.  I would like to create an AMI of the instance to use as a template for firing up new production servers but with an empty database.</p>
  <p>If I just create an AMI from the instance then I believe it will contain all of the data which will have cost implications due to the size on disk and is also a security risk as the AMI would contain customer data.</p>
  <p>I thought that I could create an AMI from the instance, then launch a new instance based on that AMI, delete all of the data, create a new AMI based on the new instance, then delete the original AMI and new instance.</p>
  <p>My specific questions are:</p>
  <ol>
  <li>Will I be able to delete the first AMI if the second AMI was based on an instance created from it?</li>
  <li>I understand that the charges for AMIs are incremental in nature.  How does it work if a new AMI is created from an instance that is smaller then the AMI that that instance was created from?</li>
  <li>Is there a better way of achieving my objective?</li>
  </ol>
  <p>Thanks</p>