I am unable to package CloudFormation template, it constantly throws an error

0

I tried the following two commands to upload artifacts and package CFN template, but doesn't seem to work -

  1. "aws cloudformation package --s3-bucket s3-swapnadeep-code-sam --template-file template.yaml --output-template-file gen/template-generated.yaml"
  2. "sam package --s3-bucket s3-swapnadeep-code-sam --output-template-file packaged.yaml"

It constantly throws an error like this -

"Unable to upload artifact src/ referenced by CodeUri parameter of helloworldpython3 resource. Parameter CodeUri of resource helloworldpython3 refers to a file or folder that does not exist"

1 Answer
1
Accepted Answer

Hi,

the error message indicates that there is an issue with the parameter CodeUriof the resource you have named helloworldpython3. More specifically, the path src/ references not a relative path but and absolute one. You likely need to change it to something like ./src. Basically referencing the folder where you code resides relative to the path your template is located.

profile pictureAWS
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed a month ago
  • Hey Ben,

    Thanks for sharing this. I could resolve this with your help.

    Thanks, Swapnadeep

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