Example usage for com.amazonaws.services.autoscaling.model SetInstanceProtectionRequest setProtectedFromScaleIn

List of usage examples for com.amazonaws.services.autoscaling.model SetInstanceProtectionRequest setProtectedFromScaleIn

Introduction

In this page you can find the example usage for com.amazonaws.services.autoscaling.model SetInstanceProtectionRequest setProtectedFromScaleIn.

Prototype


public void setProtectedFromScaleIn(Boolean protectedFromScaleIn) 

Source Link

Document

Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.

Usage

From source file:com.pinterest.arcee.autoscaling.AwsAutoScalingManager.java

License:Apache License

private void setInstanceProtection(Collection<String> instances, String groupName, boolean protect)
        throws Exception {
    SetInstanceProtectionRequest setInstanceProtectionRequest = new SetInstanceProtectionRequest();
    setInstanceProtectionRequest.setAutoScalingGroupName(groupName);
    setInstanceProtectionRequest.setInstanceIds(instances);
    setInstanceProtectionRequest.setProtectedFromScaleIn(protect);
    aasClient.setInstanceProtection(setInstanceProtectionRequest);
}