class AwsEC2Platform extends Platform implements SshBasedExperiment<AwsEC2Container> {

    AwsEC2Container buildContainerFromInstance (Instance instance) {
        String groupIdentifier = null;
        Boolean nativeAwsAutoscaling = null;
        String name = instance.getTags()
                              .stream()
                              .filter(tag -> tag.getKey().equals("Name"))
                              .findFirst()
                              .orElse(new Tag("Name", "no-name"))
                              .getValue();
        if (groupingTags != null) {
            Tag groupingTag = instance.getTags()
                                      .stream()
                                      .filter(tag -> groupingTags.contains(tag.getKey()))
                                      .min(Comparator.comparingInt(tag -> groupingTags.indexOf(tag.getKey())))
                                      .orElse(null);
            groupIdentifier = groupingTag == null ? null : groupingTag.getValue();
            nativeAwsAutoscaling = groupingTag != null && AWS_ASG_NAME_TAG_KEY.equals(groupingTag.getKey());
        }
        Placement placement = instance.getPlacement();
        String availabilityZone = placement != null ? placement.getAvailabilityZone() : AwsConstants.NO_AZ_INFORMATION;
        return AwsEC2Container.builder().awsEC2Platform(this)
                              .instanceId(instance.getInstanceId())
                              .keyName(Optional.ofNullable(instance.getKeyName()).orElse(NO_ASSIGNED_KEY))
                              .name(name)
                              .groupIdentifier(Optional.ofNullable(groupIdentifier).orElse(NO_GROUPING_IDENTIFIER))
                              .nativeAwsAutoscaling(Optional.ofNullable(nativeAwsAutoscaling).orElse(false))
                              .availabilityZone(Optional.ofNullable(availabilityZone).orElse(AwsConstants.NO_AZ_INFORMATION))
                              .publicAddress(instance.getPublicIpAddress()).imageId(instance.getImageId())
                              .privateAddress(instance.getPrivateIpAddress())
                              .build();
    }

    @Autowired  AwsEC2Platform(AmazonEC2 amazonEC2, ContainerManager containerManager, AwsEC2SelfAwareness awsEC2SelfAwareness);
    private  AwsEC2Platform();

}