Как создать кластер с экземпляром, используя java aws sdk ecs - PullRequest
0 голосов
/ 07 января 2020

Помогите создать кластер с экземпляром EC2, используя java aws sdk, я пытаюсь создать что-то подобное, но я могу создать только пустой кластер.

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