3

I have a small application deployed on an EC2 instance.

I need a staging environment so I've thought of two choices:

  • Deploy the same app again on the same instance, and that would be a staging environment. But I would really like to separate things and NOT put the two environments into the same instance.

  • Or use another instance especially for staging, but it will be expensive. So, is it good to start the staging instance right before deployment and shut it down when the tests end?

Thank you.

2

You can approach this case with multiple ways.

  • For example you can set an auto-shutdown for 20:00 pm and auto-start for 8:00 am.
  • Use Terraform to create your environment and, after deployment/testings, you can easily destroy it, saving your costs.
  • And many other ways.

I commented on paths that you can follow, so you should choose one that brings you greater benefit and agility both in creating your environments and in testing them.

Regards

2

How big is the app? How much usage will it get in staging?

If you spin it up on a t2.micro, the extra cost will be negligible, especially if you use auto-shutdown or Terraform to only have the box running when you need it.

It's critical to have separate environments for staging and production.

Finally, consider dockerizing your app if you can. Much more flexibility, and you can run it in Fargate.

1

It's better to create a new instance for staging, deploy the app, test it, stop the instance when you finish testing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.