Jay
Jay

Reputation: 21

AWS Auto Scaling group with one reserved instance and one on-demand instance?

Can AWS Auto Scaling group, with 2 EC2 instances, include one reserved instance and one on-demand instance? Intention, obviously, is to have the reserved one running always and the on-demand one go up/down for load balancing.

Upvotes: 2

Views: 948

Answers (2)

Bahadir Tasdemir
Bahadir Tasdemir

Reputation: 10783

Yes you can do that,

  • Purchase your reserved instance
  • Create An Auto Scaling Group (with a Launch Configuration uses the AMI of your reserved instance) which monitors your reserved instance with minimum and desired values are set to 1 (max is up to your > 1) and select "EC2" for "Heath checking type" and set the policy as "newestinstance" so that your "inscale(decreasing)" action will delete firstly newest instances.
  • After creating your ASG, go to the instances tab, select your instance, click edit and select "protected for inscale" so that your instance won't be deleted never when removing instances.

By this way, now you have a reserved instance watched by an ASG which cannot terminate your reserved instance, add and remove additional instances when needed (with the newestinstance policy). You will only maintain your single reserved instance.

If you want to get detailed information about how to use the alarms on "Scaling Policy", then you can investigate this aws article about policy creating.

Upvotes: 0

Matt Houser
Matt Houser

Reputation: 36053

Yes.

Reserved instances are an accounting thing. They have nothing to do with your actual infrastructure.

In your case:

  • When you have one matching EC2 instance running (regardless of how they were run), the reserved instance will apply.
  • Once a second instance is launched, the on-demand pricing will apply.
  • If either of the instances is terminated, then the reserved pricing will apply to the remaining instance.

Upvotes: 4

Related Questions