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
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ