Lightsail and CodeDeploy: Invalid on premises config file

0

Hello, I'm trying to integrate a lightsail instace running Ubuntu 22 with CodeDeploy. Tried a couple of this but the logs keep saying the my config file format is invalid. I tried removing the spaces between key and values, din't seem to work. Is there a way to troubleshoot what could be wrong with the file?

Config file /etc/codedeploy-agent/conf/codedeploy.onpremises.yml:

aws_access_key_id:*** aws_secret_access_key:*** iam_user_arn:***

Outpu from /var/log/aws/codedeploy-agent/codedeploy-agent.log 2024-02-07T18:25:38 INFO [codedeploy-agent(2748)]:mstr 2748: Spawned child 1/1 2024-02-07T18:25:38 ERROR [codedeploy-agent(3356)]: Invalid on premises config file 2024-02-07T18:25:38 ERROR [codedeploy-agent(3356)]: booting child: error during start or run: RuntimeError - The deployment failed because the format of the following on-premises configuration file is invalid: /etc/codedeploy-agent/conf/codedeploy.onpremises.yml - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/onpremise_config.rb:15:in `rescue in configure'

Marco
gefragt vor 3 Monaten210 Aufrufe
2 Antworten
0

Hello.

Please mask the contents listed in "aws_access_key_id" and "aws_secret_access_key".

Did you restart CodeDeploy Agent after updating "codedeploy.onpremises.yml"?
Looking at the documentation, the configuration seems correct.
https://docs.aws.amazon.com/codedeploy/latest/userguide/register-on-premises-instance-iam-user-arn.html#register-on-premises-instance-iam-user-arn-4

profile picture
EXPERTE
beantwortet vor 3 Monaten
  • Hi, yes, I restarted the codedeploy agent. Looking for some yml validator it suggested to remove the space between key and value, didn't worked. I keep seeing the same error.

    https://www.yamllint.com/

0

Online guidance indicates you need at least a 5 line file as found below. Your reference file appears to be missing the initial line of "---" along with a region value. Please let us know if adding to your file per below resolves your issue or not.

Reference (found in earlier responses as well): https://docs.aws.amazon.com/codedeploy/latest/userguide/register-on-premises-instance-iam-user-arn.html#register-on-premises-instance-iam-user-arn-4

---
aws_access_key_id: secret-key-id
aws_secret_access_key: secret-access-key
iam_user_arn: iam-user-arn
region: supported-region

secret-key-id is the corresponding IAM user's secret key ID you noted in Step 1: Create an IAM user for the on-premises instance or Step 3: Get the IAM user credentials.

secret-access-key is the corresponding IAM user's secret access key you noted in Step 1: Create an IAM user for the on-premises instance or Step 3: Get the IAM user credentials.

iam-user-arn is the IAM user's ARN you noted earlier in Step 1: Create an IAM user for the on-premises instance.

supported-region is the identifier of a region supported by CodeDeploy where your CodeDeploy applications, deployment groups, and application revisions are located (for example, us-west-2). For a list of regions, see Region and endpoints in the AWS General Reference.

AWS
MODERATOR
beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen