Can not run AWS CodeDeploy to Amazon Lightsail

0

Hi, I have been following instruction from https://aws.amazon.com/blogs/compute/using-aws-codedeploy-and-aws-codepipeline-to-deploy-applications-to-amazon-lightsail/ to use codedploy to depoly app.

While creating instance in lightsail i add below code in +Add launch script(all credentials & region provided):

mkdir /etc/codedeploy-agent/
mkdir /etc/codedeploy-agent/conf
cat <<EOT >> /etc/codedeploy-agent/conf/codedeploy.onpremises.yml
---
aws_access_key_id: <Access Key ID>
aws_secret_access_key: <Secret Access Key>
iam_user_arn: <IAM User ARN>
region: <Desired Region>
EOT
wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto

After creating intances, in the SSH command i: sudo service codedeploy-agent status. Error comes :

Redirecting to /bin/systemctl status codedeploy-agent.service
Unit codedeploy-agent.service could not be found.

I checked /etc/codedeploy-agent/conf/codedeploy.onpremises.yml file exist but codedeploy-agent.service file is not present in /etc/systemd/system/.

My humble asking is how to solve this. Please help me..

Thank you.

asked a month ago88 views
1 Answer
1

It appears to be related to the CodeDeploy agent either not being installed or failing to start correctly. Consider the following troubleshooting steps:

  1. Check Installation Logs

The logs are typically located at /var/log/aws/codedeploy-agent/codedeploy-agent.log.

  1. Re-run the Installation Script

Install the CodeDeploy agent for Amazon Linux or RHEL

  1. Ensure the Service is Enabled

You can do this by running: sudo systemctl enable codedeploy-agent

  1. Start the Service Manually

If the service is not running, you can start it manually using the following command: sudo systemctl start codedeploy-agent

profile picture
EXPERT
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions