aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.5k stars 1.17k forks source link

AWS SAM installed and showing in version but saying sam not found when running build command. #2860

Closed maheshcheetirala closed 3 years ago

maheshcheetirala commented 3 years ago

SAM Noty found error.

Description:

Sam is installed and showing up in version command sam installed . When i run sh samdeployment.sh its throwing an error saying SAM not found error. sam error

Steps to reproduce:

https://aws.amazon.com/blogs/machine-learning/build-a-ci-cd-pipeline-for-deploying-custom-machine-learning-models-using-aws-services/

I am trying to reproduce this on windows 10 machine.

Observed result:

Expected result:

build should succeed.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:windows 10
  2. sam --version:1.23.0
  3. AWS region:Northern virginia

Add --debug flag to command you are running

aahung commented 3 years ago

The blog post seems designed for Linux and macOS. As a workaround, I think you can directly run the content of sam_deploy.sh and adjust the path to Windows \, which results in

sam build  -t cfn\sam-template.yaml
sam deploy --template-file .\aws-sam\build\template.yaml --stack-name sam-sf-sagemaker-workflow --force-upload --s3-bucket bucket-mlops --s3-prefix sam --parameter-overrides S3ModelBucket=mlops-cicd --capabilities CAPABILITY_IAM

Please re-open if you have other questions.