Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable the CodeDeploy Agent on Amazon Linux 2?

Amazon Linux 2 already comes with cfn-init and other AWS integrated tools, but the CodeDeploy docs doesn't mention Amazon Linux 2 and running any service commands respond something similar to:

Redirecting to /bin/systemctl start codedeploy-agent.service
Failed to start codedeploy-agent.service: Unit not found.

How can I enable the CodeDeploy agent, preferably using cfn-init?

like image 510
villasv Avatar asked Dec 16 '18 15:12

villasv


People also ask

How do I check my CodeDeploy agent status?

Verify the CodeDeploy agent for Ubuntu Server is running Install it as described in Install the CodeDeploy agent for Ubuntu Server. If the CodeDeploy agent is installed and running, you should see a message like The AWS CodeDeploy agent is running .

What is AWS CodeDeploy agent?

The CodeDeploy agent is software used to facilitate deploying to servers such as Amazon EC2, on-premises instances, and other virtual machines. For more details about this release, visit the CodeDeploy agent version history. For availability in your regions, visit AWS global region table.


1 Answers

sudo yum update
sudo yum install ruby
sudo yum install wget
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto

The above worked, though it's not integrated to cfn-init so I'm still looking for a better answer.

EDIT: Working configSet for cfn-init

    cdagent:
      packages:
        yum:
          ruby: []
          wget: []
      commands:
        install:
          command: !Sub |
            wget https://aws-codedeploy-${AWS::Region}.s3.amazonaws.com/latest/install
            chmod +x ./install
            ./install auto
like image 57
villasv Avatar answered Sep 21 '22 05:09

villasv