class AwsEC2Container extends AwsContainer {

    @ChaosExperiment(experimentType = ExperimentType.STATE)
    public void restartContainer (Experiment experiment) {
        final Instant hardRebootTimer = Instant.now().plus(Duration.ofMinutes(AWS_EC2_HARD_REBOOT_TIMER_MINUTES));
        awsEC2Platform.restartInstance(instanceId);
        experiment.setSelfHealingMethod(autoscalingSelfHealingWrapper(startContainerMethod));
        experiment.setCheckContainerHealth(autoscalingHealthcheckWrapper(() -> hardRebootTimer.isBefore(Instant.now()) ? awsEC2Platform
                .checkHealth(instanceId) : ContainerHealth.RUNNING_EXPERIMENT));
        // If Ctrl+Alt+Del is disabled in the AMI, then it takes 4 minutes for EC2 to initiate a hard reboot.
    }

    private  AwsEC2Container();

}