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
?
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 .
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With