https://github.com/heiwa4126/sam-lambda-urls1
AWS Lambda Function URLsの最初のサンプル。とりあえず認証なし、CORSなしで。
https://github.com/heiwa4126/sam-lambda-urls1
aws-sam example lambda-function-urls
Last synced: 19 days ago
JSON representation
AWS Lambda Function URLsの最初のサンプル。とりあえず認証なし、CORSなしで。
- Host: GitHub
- URL: https://github.com/heiwa4126/sam-lambda-urls1
- Owner: heiwa4126
- Created: 2022-04-08T06:02:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T08:57:50.000Z (over 3 years ago)
- Last Synced: 2025-02-23T07:16:32.592Z (8 months ago)
- Topics: aws-sam, example, lambda-function-urls
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sam-lambda-urls1
[AWS Lambda Function URLs](https://aws.amazon.com/jp/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/)
の最初のサンプル。とりあえず認証なし、CORSなしで。Lambda本体はpython 3.8
# デプロイ
```sh
sam build
sam deploy --guided # --guidedは最初の1回だけ
```設定値はデフォルトでいいです。
# テスト
stackのoutputの `HelloWorldFunctionUrl` をcurlで呼んでください。
実行例:
```
$ curl https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.lambda-url.ap-northeast-1.on.aws/
{"body": "hello world\n"}
```# スタックの削除
```sh
sam delete --no-prompts
```
で消えます。
いま認証なしなんで、動作確認したらさっさと消したほうがいいと思います。# メモ
まだ AWS::Lambda::Url リソースのドキュメントがないけど、
URLのアトリビュートは .FunctionUrl でした。## 追記(2022-04-11)
ドキュメント出た。
[AWS::Lambda::Url - AWS CloudFormation](https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html)AuthTypeについては
[Security and auth model for Lambda function URLs - AWS Lambda](https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/urls-auth.html)