LoginSignup
0
0

More than 1 year has passed since last update.

cloud9でsamを利用しapiを作成する

Posted at

手順

codecommitにてレポジトリを作成する

作成方法は後日

cloud9を作成する

作成方法は後日

コマンドライン操作

$ sam init

この時作成されるファイルの紹介
app.py: lambdaの中身を記述するためのもの
template.yaml: cloudformtionの中身となるもの
requirements.text: importするライブラリを記入するもの

$ sam build --use-container
$ sam deploy -g

同じコンテナをビルドし直す場合は-gオプションは不要

API GATEWAYからAPIを叩く

  1. API GATEWAYのメニューバーからステージをクリック
  2. URLの呼び出しをクリック
  3. URLの末尾にパスを加える(template.yamlの後半の以下のコードのpath:を参照)
      Events:
        HelloWorld:
          Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
          Properties:
            Path: /hello
            Method: get
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0