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
?
答案 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