Error in command "sam package" Creating the SAM Pipeline according with The Complete AWS SAM Workshop

0

I´m trying to create de SAM pipeline for the hello world app according to the workshop (https://catalog.workshops.aws/complete-aws-sam/en-US/module-4-cicd/module-4-cicd-codepipeline/50-sampipeinit) but when I execute the command "sam deploy -t codepipeline.yaml --stack-name sam-app-pipeline --capabilities=CAPABILITY_IAM" the stage BuildAndPackage fails with the error “COMMAND_EXECUTION_ERROR: Error while executing command: sam package --s3-bucket ${TESTING_ARTIFACT_BUCKET} --region ${TESTING_REGION} --output-template-file packaged-test.yaml. Reason: exit status 1”.

Anyone have any ideas on how to find more information about the error or what kind of things I have to review?

Thanks

asked 10 months ago689 views
3 Answers
1
Accepted Answer

The parameters "--s3-bucket" and "resolve_s3" specified in the "sam package" command cannot be used simultaneously.
So disabling either one will eliminate the error.
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html

The name of the Amazon S3 bucket where this command uploads your AWS CloudFormation template. If your template is larger than 51,200 bytes, then either the --s3-bucket or the --resolve-s3 option is required. If you specify both the --s3-bucket and --resolve-s3 options, then an error will result.

profile picture
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed a month ago
1

Is it possible to share the logs around the logs where the error is occurring as well?
Perhaps "resolve_s3" in "samconfig.toml" is set to true.
If it is true, change it to false and then git push.
Try changing the settings as follows.

[default.package.parameters]
resolve_s3 = false
profile picture
EXPERT
answered 10 months ago
0

Thanks for your answer Riku, the problem was fixed by setting resolve_s3 in false as you said. Now I would like to know why this parameter caused the error, could you give me a little explanation or suggest some documentation?

answered 10 months ago

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