使用java aws sdk帮助创建带有实例EC2的群集,我正在尝试创建类似的内容,但是 我只能创建一个空集群。
AmazonECS client = AmazonECSAsyncClientBuilder.standard().build();
com.amazonaws.services.ecs.model.CreateClusterRequest createClusterRequest = new CreateClusterRequest().withClusterName("my_cluster");
CreateClusterResult createClusterResult = client.createCluster(createClusterRequest);
RegisterContainerInstanceRequest registerContainerInstanceRequest = new RegisterContainerInstanceRequest().withTotalResources(new Resource().withName("CPU").withIntegerValue(512));
RegisterContainerInstanceResult registerContainerInstanceResult = client.registerContainerInstance(registerContainerInstanceRequest);
Exception in thread "main" com.amazonaws.services.ecs.model.InvalidParameterException: The identity document and identity document signature were not valid. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: 7c266843-e2f1-4f21-b3bc-0e6cf078b327)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1660)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1324)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1074)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:745)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:719)