0
0

More than 1 year has passed since last update.

AWS SAM の使いかた

Last updated at Posted at 2021-09-24

参考ページ
チュートリアル: Hello World アプリケーションのデプロイ

次の環境で確認しました。

$ python --version
Python 3.9.7
$ sam --version
SAM CLI, version 1.31.0

プログラムの作成

sam init --name sample-sam-app --runtime python3.9 --dependency-manager pip -
-app-template hello-world

ビルド

cd sample-sam-app
sam build

デプロイ

sam deploy --stack-name sample-sam-app \
    --region ap-northeast-1 \
    --guided

次のようなメッセージが出てきます。

Value               https://123456o4of.execute-api.ap-northeast-1.amazonaws.com/Prod/hello/

テスト

$ curl https://123456o4of.execute-api.ap-northeast-1.amazonaws.com/Prod/hello/
{"message": "hello world"}
http https://123456o4of.execute-api.ap-northeast-1.amazonaws.com/Prod/hello/

API Gateway が出来ていることを確認する方法

aws apigateway get-rest-apis | grep \"name\"
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