Deploying a function via AWS Code Build fails

Encountering an error when deploying a function via AWS Code Build and the same works when I do it from my mac. Any help is appreciated

[Container] 2020/07/10 21:08:57 Running command sls package
Serverless: Packaging service…

[Container] 2020/07/10 21:08:59 Running command sls deploy function -f getParameter

Serverless Error ---------------------------------------

The function “getParameter” you want to update is not yet deployed. Please run “serverless deploy” to deploy your service. After that you can redeploy your services functions with the “serverless deploy function” command.

Get Support --------------------------------------------
Docs: xxxxxx
Bugs: xxxxxx
Issues: xxxxxx

Your Environment Information ---------------------------
Operating System: linux
Node Version: 10.19.0
Framework Version: 1.74.1
Plugin Version: 3.6.15
SDK Version: 2.3.1
Components Version: 2.31.12

[Container] 2020/07/10 21:09:00 Command did not exit successfully sls deploy function -f getParameter exit status 1
[Container] 2020/07/10 21:09:00 Running command echo Completed the build phase…
Completed the build phase…

[Container] 2020/07/10 21:09:00 Phase complete: BUILD State: FAILED
[Container] 2020/07/10 21:09:00 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sls deploy function -f getParameter. Reason: exit status 1
[Container] 2020/07/10 21:09:00 Entering phase POST_BUILD