Answers: <p>How big is the app? How much usage will it get in staging?</p>
  <p>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.</p>
  <p>It's critical to have separate environments for staging and production.</p>
  <p>Finally, consider dockerizing your app if you can. Much more flexibility, and you can run it in Fargate.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-07-27T18:37:12.837Z
Answers: 2021-07-27T18:37:12.837Z
Answers: Benjamistan
Answers: <p>You can approach this case with multiple ways.</p>
  <ul>
  <li>For example you can set an auto-shutdown for 20:00 pm and auto-start for 8:00 am.</li>
  <li>Use <strong>Terraform</strong> to create your environment and, after deployment/testings, you can easily destroy it, saving your costs.</li>
  <li>And many other ways.</li>
  </ul>
  <p>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.</p>
  <p>Regards</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-07-27T09:21:53.793Z
Answers: 2021-07-27T09:21:53.793Z
Answers: Akae Beka
Answers: <p>It's better to create a new instance for staging, deploy the app, test it, stop the instance when you finish testing.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-07-27T07:01:22.570Z
Answers: 2021-07-27T07:01:22.570Z
Answers: Mhm0ud
Body: <p>I have a small application deployed on an EC2 instance.</p>
  <p>I need a staging environment so I've thought of two choices:</p>
  <ul>
  <li><p>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.</p>
  </li>
  <li><p>Or use another instance especially for staging, but it will be expensive. So, is it good to <strong>start the staging instance right before deployment and shut it down when the tests end</strong>?</p>
  </li>
  </ul>
  <p>Thank you.</p>
  
Tags: <amazon-ec2><deployment><testing><environments>
Title: Should I shut down the staging environment when the deployment test ends?
UserDisplayName: mr L
ThreadText: # Should I shut down the staging environment when the deployment test ends?
  
  (Asked by: username_0 on 2021-07-26)
  
  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.
  
  **Tags:** amazon-ec2, deployment, testing, environments
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2021-07-27. Score: 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.
  
  
  ---
  
  ### Answer by username_2 on 2021-07-27. Score: 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
  
  
  ---
  
  ### Answer by username_3 on 2021-07-27. Score: 1
  
  It's better to create a new instance for staging, deploy the app, test it, stop the instance when you finish testing.
  
  
  ---
  
  