Skip to content

Instantly share code, notes, and snippets.

@moriya-hm5
Last active December 30, 2019 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriya-hm5/de3fddb330abefa8f14ecfe8ad344058 to your computer and use it in GitHub Desktop.
Save moriya-hm5/de3fddb330abefa8f14ecfe8ad344058 to your computer and use it in GitHub Desktop.
$ sam init
[+] Initializing project structure...
[SUCCESS] - Read sam-app/README.md for further instructions on how to proceed
[*] Project initialization is now complete
$ cd sam-app\hello_world
$ npm install // axiosとか入れておく
npm notice created a lockfile as package-lock.json. You should commit this file.
added 34 packages from 460 contributors and audited 44 packages in 4.494s
found 0 vulnerabilities
$ cd ..
$ sam local generate-event apigateway aws-proxy > event.json
$ sam local invoke HelloWorldFunction --event event.json
2019-12-29 19:35:15 Invoking app.lambdaHandler (nodejs8.10)
2019-12-29 19:35:15 Found credentials in shared credentials file: ~/.aws/credentials
Fetching lambci/lambda:nodejs8.10 Docker container image......
2019-12-29 19:35:18 Mounting C:\Users\takahashi\Documents\vscode\aws-sam\sample1\sam-app\hello_world as /var/task:ro inside runtime container
START RequestId: 56b6ed58-020f-1456-51eb-dee16udbcede Version: $LATEST
END RequestId: 56b6ed58-020f-1456-51eb-dee16udbcede
REPORT RequestId: 56b6ed58-020f-1456-51eb-dee16udbcede Init Duration: 266.09 ms Duration: 431.93 ms Billed
Duration: 500 ms Memory Size: 128 MB Max Memory Used: 40 MB
{"statusCode":200,"body":"{\"message\":\"hello world\",\"location\":\"126.80.111.134\"}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment