Skip to content

Commit

Permalink
#1906 terminate instead of stop
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Feb 29, 2024
1 parent 4385a50 commit f915217
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/rultor/agents/aws/KillsInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
package com.rultor.agents.aws;

import com.amazonaws.services.ec2.model.StopInstancesRequest;
import com.amazonaws.services.ec2.model.TerminateInstancesRequest;
import com.jcabi.aspects.Immutable;
import com.jcabi.log.Logger;
import com.jcabi.xml.XML;
Expand Down Expand Up @@ -75,11 +75,11 @@ public KillsInstance(final AwsEc2 aws, final long mins) {
@Override
public Iterable<Directive> process(final XML xml) throws IOException {
final String instance = xml.xpath("/talk/ec2/instance/text()").get(0);
this.api.aws().stopInstances(
new StopInstancesRequest()
this.api.aws().terminateInstances(
new TerminateInstancesRequest()
.withInstanceIds(instance)
);
Logger.info("Killed AWS instance %s because it's too old", instance);
Logger.info("Terminated AWS instance %s because it's too old", instance);
return new Directives();
}
}

0 comments on commit f915217

Please sign in to comment.