Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用快照在JAVA AWS sdk中创建EC2实例_Java_Amazon Ec2_Amazon Web Services_Ec2 Ami - Fatal编程技术网

使用快照在JAVA AWS sdk中创建EC2实例

使用快照在JAVA AWS sdk中创建EC2实例,java,amazon-ec2,amazon-web-services,ec2-ami,Java,Amazon Ec2,Amazon Web Services,Ec2 Ami,我可以使用JavaSDK和一些图像创建一个EC2实例。目前我正在像这样创建它 private static void createInstance() throws AmazonServiceException, AmazonClientException, InterruptedException { RunInstancesRequest runInstancesRequest = new RunInstancesRequest()

我可以使用JavaSDK和一些图像创建一个EC2实例。目前我正在像这样创建它

 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);


    }

有人能告诉我如何使用映像的快照而不是映像本身来创建ec2实例吗?

您必须首先从快照创建映像。然后您可以从该映像启动实例。

但是如何启动-1.除了显而易见的事实,我什么也没解释。