Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
How to provide instance identity document for registering the container instance to AWS ECS Cluster using AWS Javascript SDK?

I'm using AWS Javascript SDK to create a cluster and register the container instance for ECS task. I got struck by providing the instance identity document value for the request parameters. I'm trying to register my running EC2 instance as container instance. I got the instance identity document by executing the following command curl command.

curl http://169.254.169.254/latest/dynamic/instance-identity/document/

Output:

{
  "accountId" : "01234567891",
  "architecture" : "x86_64",
  "availabilityZone" : "us-east-11",
  "billingProducts" : null,
  "devpayProductCodes" : null,
  "marketplaceProductCodes" : null,
  "imageId" : "ami-123456789012d",
  "instanceId" : "i-12345678901",
  "instanceType" : "t2.micro",
  "kernelId" : null,
  "pendingTime" : "2020-07-12T15:57:19Z",
  "privateIp" : "172.31.33.40",
  "ramdiskId" : null,
  "region" : "us-east-1",
  "version" : "2017-09-30"
}

I have converted the output to string but I'm getting an error in NodeJS code.

{ InvalidParameterException: An identity document was provided, but not valid.

message:
'The identity document and identity document signature were not valid.',
code: 'InvalidParameterException',
time: 2020-07-14T07:30:59.782Z,
requestId: '7bca816f-8c8f-4e6e-8e77-04c93b45c17e',
statusCode: 400,
retryable: false,
retryDelay: 68.57527460306602 } 'InvalidParameterException: The identity document and identity document signature were not valid.\n  

Do we have to execute registerContainerInstances API from an EC2 instance?

Please guide!!!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I have fixed the problem. Make use of EC2 SDK to launch an instance with ECS AMI Image and added the following script in the user data.

#!/bin/bash
echo "ECS_CLUSTER=YOUR_CLUSTER_NAME" >> /etc/ecs/ecs.config

The above code will register to the specified ECS cluster. It is not required to use registerContainerInstances API. It would be great, if AWS removes this API from the API reference.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda