unknown_boundaries
unknown_boundaries

Reputation: 1590

Is there a way to retain same instances when AWS autoscales up/down the instances

We've deployed app in AWS with minimum x instances (with in-memory caching at instance level). When AWS scales down any instance can go down. Is there a way to retain original x instances and AWS should destroy (scale down) the newest instance (last created by AWS)?

Upvotes: 0

Views: 57

Answers (1)

John Hanley
John Hanley

Reputation: 81386

You can protect EC2 instances from termination using the Instance Protection features.

Instance Protection for Auto Scaling

You can modify EC2 auto scaling with custom termination policies. In your case, select Newest Instance to have the youngest EC2 instances terminate.

This link documents the various features:

Controlling Which Auto Scaling Instances Terminate During Scale In - Amazon EC2 Auto Scaling

By combining the above two features, you should be able to achieve your objective.

Upvotes: 5

Related Questions