문제

I can create an EC2 instance using java sdk using some image. Currently I am creating it like this

 private static void createInstance()
            throws AmazonServiceException, AmazonClientException, InterruptedException
    {
        RunInstancesRequest runInstancesRequest = new RunInstancesRequest()
        .withInstanceType("m1.small")
        .withImageId("ami-e565ba8c")
        .withMinCount(1)
        .withMaxCount(1)
        .withKeyName("mykey")
        ;
        RunInstancesResult runInstances = ec2.runInstances(runInstancesRequest);


    }

Can someone please guide me that how can I create ec2 instance using snapshot of image instead of image itself?

도움이 되었습니까?

해결책

You will have to create image from the snapshot first. Then you can launch instance from that image.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top