It generally costs nothing to publish a book on Amazon. You can either self-publish through their Kindle Direct Publishing program, or use their CreateSpace service to publish a physical book. The only costs involved are for things like formatting, cover design, and editing, which you can either do yourself or hire someone to do for you.