AWS Elastic Beanstalk:环境必须具有与之关联的实例配置文件

时间:2017-07-11 09:22:53

标签: amazon-web-services amazon-ec2 elastic-beanstalk aws-sdk amazon-elastic-beanstalk

我正在尝试在Elastic Beanstalk中创建一个环境,这是我的代码:

PUT /products/product/un1qu3-1d-b718-105973677e95/_update
{
   "script": {
      "inline": "ctx._source.state = \"packaged\"",
      "lang": "painless"
   },
   "upsert": {
      "id": "un1qu3-1d-b718-105973677e95",
      "state": "packaged"
   }
}

上述代码成功执行并打印输出如下:

AWSElasticBeanstalk client = AWSElasticBeanstalkClientBuilder.defaultClient(); 
    CreateEnvironmentRequest createEnvironmentRequest = new CreateEnvironmentRequest()
                    .withApplicationName("MySampleApplicationFour")
                    .withEnvironmentName("MySampleApplicationFour-env")
                    .withCNAMEPrefix("MySampleApplicationFour")
                    .withSolutionStackName("64bit Amazon Linux 2017.03 v2.5.1 running Java 8")
                    ;

            CreateEnvironmentResult result = client.createEnvironment(createEnvironmentRequest);
            System.out.println(result);

但是当我看到AWS Beanstalk控制台时,它将环境显示为已终止

这是我的AWS控制台:

console screen

有人能告诉我如何在AWS Elastic Beanstalk中创建运行环境吗?

1 个答案:

答案 0 :(得分:0)

您只是尝试更改您用于AWSClient构建器的Region,并尝试创建环境。