Model (SAM) CLI Options: --debug Turn on debug logging --version Show the version and exit. --help Show this message and exit. Commands: init Initialize a serverless application with a... package Package an AWS SAM application. This is an alias for 'aws cloudformation package'. local Run your Serverless application locally for... validate Validate an AWS SAM template. deploy Deploy an AWS SAM application. This is an alias for 'aws cloudformation deploy'. commands
- Read sample_sam_app/README.md for further instructions on how to proceed [*] Project initialization is now complete $ tree sample_sam_app . ᵓᴷᴷ README.md ᵓᴷᴷ hello_world ᴹ ᵓᴷᴷ app.js ᴹ ᵓᴷᴷ package.json ᴹ ᵋᴷᴷ tests ᴹ ᵋᴷᴷ unit ᴹ ᵋᴷᴷ test_handler.js ᵋᴷᴷ template.yaml 3 directories, 5 files sam init
[ARGS]... Generate an event Options: --help Show this message and exit. Commands: api ɹGenerates a sample Amazon API Gateway event dynamodb Generates a sample Amazon DynamoDB event kinesis Generates a sample Amazon Kinesis event s3 Generates a sample Amazon S3 event schedule Generates a sample scheduled event sns Generates a sample Amazon SNS event sam local generate-event Lambda͕τϦΨʔ͞Εͨͱ͖ʹ͞ΕΔ֤Πϕϯτͷαϯϓ ϧσʔλΛग़ྗ͢Δ
api [OPTIONS] Options: -m, --method TEXT HTTP method (default: "POST") -b, --body TEXT HTTP body (default: "{ "test": "body"}") -r, --resource TEXT API Gateway resource name (default: "/{proxy+}") -p, --path TEXT HTTP path (default: "/examplepath") --debug Turn on debug logging --help Show this message and exit. sam local generate-event
/127.0.0.1:3000/hello [GET] 2018-08-20 22:40:53 You can now browse to the above endpoints to invoke your functions. You do not need to restart/reload SAM CLI while working on your functions changes will be reflected instantly/automatically. You only need to restart SAM CLI if you update your AWS SAM template 2018-08-20 22:40:53 * Running on http:/ /127.0.0.1:3000/ (Press CTRL+C to quit) sam local start-api DockerίϯςφͰAPIαʔόʔΛىಈɻ
shared credentials file: ~/.aws/credentials 2018-08-20 22:42:48 Starting new HTTPS connection (1): iam.amazonaws.com /Users/yuto-ogi/Work/aws_sam/sample_sam_app/template.yaml is a valid SAM Template template.yaml ͷೖྗ༰Λݕূ͢Δɻ
packaged artifacts and wrote output template to file packaged.yaml. Execute the following command to deploy the packaged template aws cloudformation deploy --template-file /Users/yuto-ogi/Work/aws_sam/sample_sam_app/ packaged.yaml --stack-name <YOUR STACK NAME> sam package
deploy usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument --template-file is required