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 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr
profile picture
EXPERTE
überprüft vor 2 Monaten
  • Hey Ben,

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

    Thanks, Swapnadeep

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