Sriwantha Attanayake
Sriwantha Attanayake

Reputation: 7908

AWS CodeDeploy ymal file error

I am deploying an application using AWS code deploy to Windows environment. I use an apspec.yml yaml file. When I deploy the application I get following error

The deployment failed because an invalid version value () was entered in the application specification file. Make sure your AppSpec file specifies "0.0" as the version, and then try again.

It seems like there is a problem with encoding or line ending. All the materials in the internet are for linux but not for windows. I use visual studio editor to edit this file. How to fix this issue?

Upvotes: 4

Views: 2290

Answers (4)

Manoj Kumar Bisht
Manoj Kumar Bisht

Reputation: 24

Change the Encoding format by simply opening it notepad++ from UTF-8-BOM to UTF-8

enter image description here

Upvotes: 0

H6_
H6_

Reputation: 32808

In my case the encoding was wrong. appspec.yml should be saved as UTF-8 and not UTF-8 BOM.

BTW: The encoding can be changed in VS 2017 using File > Save as.., then the down arrow at the Save-Button ... Save with encoding...

Upvotes: 5

Ravi
Ravi

Reputation: 982

Make sure your appspec.yml starts with below line

version: 0.0

codedeploy requires this attribute as must. refer this

Upvotes: 2

Sriwantha Attanayake
Sriwantha Attanayake

Reputation: 7908

The issue is in the line ending. If you create a yml file make sure you use \n line ending (linux way of line ending) instead of \r\n (windows way of line ending). If your editor is visual studio when you safe the yml file save it as follows. File->Advanced Saved Options

enter image description here

Upvotes: 4

Related Questions