Error when trying to register a windows on premise SSM agent (and missing error details)

0

I'm new to SSM, and just wanted to set up a test agent on a windows VM. I followed the hybrid environment tutorial. It resulted in the fowwlowing error, when running the agent installation script (in the $env:ProgramData\Amazon\SSM\Logs\erros.log file):

ERROR [processRegistration @ agent_parser.go.177] Registration failed due to error registering the instance with AWS SSM. InvalidActivation:

As you can see, the details about the InvalidActivation are missing... What can I do to track the error ?

  • Have you tried it on an EC2 to make sure the dependencies are all set up?

질문됨 2년 전2159회 조회
3개 답변
0

Hello

Please check the Activation Code, as the Error says the Code. is invalid. $code = "activation-code", How to create activation Code.

Here is the link to find the Activation https://eu-west-1.console.aws.amazon.com/systems-manager/activations/ Check for Activation ID and **Activation ID ** use in the CLI while running the command.

$code = "activation-code"
$id = "activation-id"
$region = "region"
$dir = $env:TEMP + "\ssm"
New-Item -ItemType directory -Path $dir -Force
cd $dir
(New-Object System.Net.WebClient).DownloadFile("https://amazon-ssm-$region.s3.$region.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe", $dir + "\AmazonSSMAgentSetup.exe")
Start-Process .\AmazonSSMAgentSetup.exe -ArgumentList @("/q", "/log", "install.log", "CODE=$code", "ID=$id", "REGION=$region") -Wait
Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration")
Get-Service -Name "AmazonSSMAgent"
profile picture
GK
답변함 2년 전
0

We just had this error occur as well, but on a LInux external instance. Generating a new activation code and id worked fine. I'm curious that the activation code that failed started with a / and also contained a +, the successful activation code was only [a-z,A-Z,0-9]

답변함 2년 전
0

Activation code can be created by using the below command in AWS Cloud Shell. Running it in command line makes it more easier for saving the activation code. When created using the console you miss capturing the Activation Code.

aws ssm create-activation \
  --default-instance-name MyWebServers \
  --description "Activation for Finance department webservers" \
  --iam-role service-role/AmazonEC2RunCommandRoleForManagedInstances \
  --registration-limit 10 \
  --region us-east-2 \
  --tags "Key=Department,Value=Finance"
AWS
Anuraag
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠