'How to give the local zip path in AWS CouldFormation YAML CodeUri?

I have exported a lambda YAML from its export funtion using Download AWS SAM file.

Also I have Downloaded the code zip file from Download deployment package.

enter image description here

in the YAML file we need to give the CodeUri in the Downloaded YAML it is . as shown in the below picture.

enter image description here

So when I upload it in the AWS CouldFormation it says:

'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter.

I need to know is there a way to give the zip file in the CodeUri from the local file path rather then uploading it in the S3.

I have tried with the zip file name I downloaded as well and still I get the same error.

enter image description here



Solution 1:[1]

You have to first run package command. It may not work with zip itself, so you may try with unpacked source code.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcin