如何在Amazon Linux 2上启用CodeDeploy代理?

时间:2018-12-16 15:27:23

标签: amazon-web-services aws-code-deploy

Amazon Linux 2已经附带了cfn-init和其他AWS集成工具,但是CodeDeploy docs没有提到Amazon Linux 2,并且运行任何服务命令的响应类似于:

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

如何启用代码部署代理,最好使用cfn-init

1 个答案:

答案 0 :(得分:0)

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

以上方法有效,尽管它尚未集成到cfn-init中,所以我仍在寻找更好的答案。

编辑:cfn-init的有效configSet

    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