0
0

More than 1 year has passed since last update.

【serverlessフレームワーク】eventsを設定したのにエンドポイント設定されない

Posted at

はじめに

プログラミング学習中の@kat_logと申します。

serverless flameworkの学習にて起きた問題の解決メモになります🙇
serverless-api-gateway-throttlingを使用し、
serverless.ymlに、AWSのLambdaのAPIをインターネットに公開するeventsを記載したのに、npx serverless deployにてデプロイしてもエンドポイントが作られない問題が発生し、解決しました🙌
(超凡ミスでした…)

image.png

結論

serverless.ymlのインデント設定ミスでした…

serverless.yml
  hello:
    handler: src/hello.handler
    events:
      - httpApi:
        method: get # ←←←←←←ココです
        path: /hello # ←←←←←←ココです

serverless.yml
  hello:
    handler: src/hello.handler
    events:
      - httpApi:
          method: get # ←←←←←←ココです
          path: /hello # ←←←←←←ココです

エンドポイントが追加されました!🙌↓

image.png

image.png

おわりに

お読みいただきありがとうございました!
どなたかの参考になれば嬉しいです。

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