Getting an error when trying to register EC2 with ECS Cluster

895 views Asked by At

Working on AWS and at a loss with this...

I am trying to register an EC2 instance to an ECS Cluster, the EC2 instance was launched as part of Codestar project.

Steps I have followed as per AWS documentation:

  • Go to ECS
  • Access Cluster
  • Click on Register External Instances
  • Click to next page
  • Copy the Curl command for Linux to register the EC2 to the Cluster.

When I input the Curl command into the Linux CLI it runs, however stalls on this line: Trying to wait for ECS agent to start ...

Soon after I recieve an error that states: Timed out waiting for ECS Agent to start. Logs show:

===================================================

level=error time=2022-06-14T18:19:25Z msg="Unable to register as a container instance with ECS: InvalidParameterException: The identity document and identity document signature were not valid." module=client.go level=error time=2022-06-14T18:19:25Z msg="Error registering container instance" error="InvalidParameterException: The identity document and identity document signature were not valid."

===================================================l

Can anyone help identify what the issue is?

TIA!

1

There are 1 answers

0
user2500414 On

Thanks for your input - Mark B

I had a Eureka moment!

Well it dosent resolve the error I posted, but found another way around this. Basically I do not need to use or register the EC2 instance created by codestar.

I was able to update the codepipeline 'Deploy' stage to deploy to ECS (instances) and with a few tweaks to the codestar IAM role it is working!

So can consider the matter closed.

Many thanks