Say I have one prod environment and one dev environment in elastic beanstalk. I deploy my code to dev and it works and all's well, but when I deploy to production I get an error (note this is possible since sometimes instances get corrupted during deploys and apache breaks). What are the pros and cons of this solution:
Now, is SEO a concern -- if I switch around my domain between two elastic beanstalk environments, would the SEO be harmed?
The following solution is one that I have used many times without incident but remember to always test you solutions before production use.
The solution will use the following environment names which you should map to internal DNS names:
PROD01.elasticbeanstalk.com > www.example.com
PROD02.elasticbeanstalk.com
DEV01.elasticbeanstalk.com > dev-www.example.com
Typically, after developing and testing your application locally, you will deploy your application to AWS Elastic Beanstalk environment DEV01. At this point, your application will be live at URL dev-www.example.com.
Now that you have tested your application, it is easy to edit your application, redeploy, and see the results.
When you are satisfied your changes you made to your application, you can deploy it to your PROD02.elasticbeanstalk.com production environment. Using the Application Versions page promote the code running on DEV01 onto PROD02. Using your hosts file make sure everything is in order and then hit the URL swap.
This will switch PROD01.elasticbeanstalk.com and PROD02.elasticbeanstalk.com environment URL's seamlessly with zero downtime on your application.
Once you've made sure all your traffic is switched you can then update your original production environment following the same method, switch back and remove PROD01.elasticbeanstalk.com to prevent the extra cost (or you can leave it if you don't mind the $$ spend).