localstack / localstack/serverless-localstack

Static API Gateway V1 Endpoints

未關閉
#270 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

aws:apigateway status: backlog
主要語言
JavaScript
星號
542
分支
92
PR 合併指標
30 天內沒有已合併 PR

描述

Hi team 👋

### Context
My project is using localstack + severless.

I have my lambda function and I want to deploy to the localstack environment. After I deployed successfully, I find out that the endpoints (check screenshot below) is printing out in the stdout with a random rest-api-id (from the screenshot it is **q7yho9op8e**)
Screenshot 2024-11-08 at 11 24 14 AM

I cannot find a localstack-severless documentation to teach me how to have the static URL (since the above rest-api-id keep changing after each localstack deployment)

But I found this [localstack doc](https://docs.localstack.cloud/user-guide/aws/apigateway/), which provides a way to have the static URL by passing the tag '_custom_id_ ' to localstack api creation.
![Screenshot 2024-11-08 at 11 25 46 AM](https://github.com/user-attachments/assets/badaf1eb-c92b-4b30-bdb6-d49b23f10080)

I also found that there is a way to pass the tag to the Api Gateway V1 by following this [serverless doc](https://www.serverless.com/framework/docs/providers/aws/events/apigateway#tags--stack-tags)
![image](https://github.com/user-attachments/assets/cf4ced25-b193-4d9f-8c9d-f0a40eab4c7b)

### Test Process
1. spin up the localstack by run command `localstack start`
2. deploy the lambda to localstack by running `sls deploy --stage local --config serverless.local.yml`
3. check endpoints from sls deploy stdout

### Expected
I am expecting the api endpoint should looks like
http://localhost:4566/restapis/tagsMyId123/local/_user_request_ or http://localhost:4566/restapis/stackTagsMyId123/local/_user_request_

### Actual
As the result, the URL is still not static after deployment with tag set in the severless.yml (check screenshot below)
Screenshot 2024-11-08 at 11 30 13 AM

### Questions:
1. Does localstack-serverless plugin support the feature that mentioned in the localstack doc?
5. Is there a way I can have the static URL since I need the static URL to run my e2e testing.

Many thanks 🙏

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

使用 `serverless.yml` 中顯示的標籤,透過 `localstack start` 和 `sls deploy --stage local --config serverless.local.yml` 重現部署。比較各次部署中產生的 API Gateway V1 端點,並檢查參與 API 建立的 plugin entry points。完成的標準是確定所要求的靜態 URL 是否受支援,並記錄或實作所需的行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
api
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。