Skip to main content

amazon

How to: Migrate an EC2 instances to a new availability zone

Recently an EC2 instance we were using in a production environment was scheduled to go down for maintenance. Normally this would be fine and we would let AWS just handle this. However, their scheduled maintenance window was set for 21:00 UTC, which equates to 17:00 EST. In other words, right at the end of the work day. Not cool!

In order to use a maintenance schedule of our choosing, we had to migrate our production instance into a different availability zone prior to Amazon's schedule. So, we setup a test instances and tested migrating. Our successful steps are below:


AWS - IAM Permissions - Setup permissions for one user to access only one S3 bucket

While using Amazon's AWS system, we needed to give access to one S3 bucket. Todo so, we ended up using Amazon's IAM. Once we created the user in the AWS system, we created the following policy to allow this new user to only be able to read/write to their bucket:


Restoring EBS Snapshots for Backup Restore

Today I had the unfortunate need to get a restored database from an Amazon EBS snapshot. To do this I logged into the Amazon AWS management console and determined which snapshot I needed to restore from. Once I highlighted the correct snapshot, I clicked the 'Create Volume' button. Next, I chose which availability zone the snapshot should reside in and click 'Create'

Next, I spun up a new instance of the production server, using the same AMI (ami-294aa340). Once the new instance was created, I attached the volume I created above to the instance and logged into the server.