Failed to Install the CodeDeploy Agent Using AWS Systems Manager

0

I set up my Application and Development Group on CodeDeploy EC2 platform where the setup procedure helped me create a State Manager to install the CodeDeploy agent on my EC2 instance for the upcoming developments, but the Run Command history showed a failure of the installation and the CodeDeploy agent is NOT installed and running on my instance.

The instance is assumed right role (incluing AmazonEC2RoleforAWSCodeDeploy, AmazonS3ReadOnlyAccess, and AmazonSSMManagedInstanceCore) for SSM, CodeDeploy and S3 bucket, and CodeDeploy has the sufficent permissions from the role (including AWSCodeDeployRole) to work on EC2 platform. No any issues for SSM and EC2, verified the SSM agent is running on my EC2 instance. However, got error output from Run Command at step 2 - "configurePackage":

failed to download manifest - failed to retrieve package document description: InvalidDocument: Document with name AWSCodeDeployAgent does not exist.

And here's some metadata of the command:

"Command document": "AWS-ConfigureAWSPackage",
"Command parameters": {
    "action": "Install",
    "additionalArguments": "{}",
    "installationType": "Uninstall and reinstall",
    "name": "AWSCodeDeployAgent",
    "version": ""
}

I can install CodeDeploy agent using the command line, but I want to figure out how it comes to this error, please help me if you have any ideas or encoutered the same situation before.

질문됨 3달 전173회 조회
1개 답변
0

Not being able to see exactly how you might have tried to do this here is a solution below that should successfully install the CodeDeploy agent

{
  "schemaVersion": "2.2",
  "description": "Install CodeDeploy Agent",
  "parameters": {},
  "mainSteps": [
    {
      "action": "aws:runShellScript",
      "name": "installCodeDeployAgent",
      "inputs": {
        "runCommand": [
          "#!/bin/bash",
          "sudo yum update -y",
          "sudo yum install ruby -y",
          "sudo yum install wget -y",
          "cd /home/ec2-user",
          "wget https://aws-codedeploy-eu-west-2.s3.amazonaws.com/latest/install",
          "chmod +x ./install",
          "sudo ./install auto > /tmp/logfile",
          "sudo service codedeploy-agent start"
        ]
      }
    }
  ]
}

Save the document and use the AWS Console, CLI, or a SDK to execute this.

AWS
Barry M
답변함 2달 전
profile picture
전문가
검토됨 한 달 전

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

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

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

관련 콘텐츠