Serverless Stack 外掛
外掛套件 | @rushstack/heft-serverless-stack-plugin |
外掛名稱 | serverless-stack-plugin 由 ServerlessStackPlugin.ts 實作 |
外掛設定檔 | (無) |
heft.json 選項 | (無) |
這是用於使用 Serverless Stack (SST) 架構建置應用程式的 Heft 外掛。採用這種方法後,SST 工具鏈 只會用於合成 CloudFormation 堆疊和部署應用程式,而 Heft 則負責編譯、檢查和測試 TypeScript 專案。
何時使用
如果 Lambda 服務是使用 Serverless Stack 架構建置的,就會用到。
運作方式
如果不提供 --sst
參數,這個外掛不會有任何效果。如果提供了這個參數
heft build --sst
的運作方式與sst build
類似,會在build/cdk.out/
目錄中合成 CloudFormation 堆疊。請參閱 這份文件 以取得詳細資料。Heft 的build-watch
模式也獲得支援。heft start --sst
的運作方式與sst start
類似,會將 stub lambda 部署到 AWS,然後在本地端啟動 WebSocket 應用程式進行除錯。請參閱 這份文件 以取得詳細資料。
請注意,目前
heft build --sst
要求提供 AWS 憑證,這限制了在單一儲存庫 (monorepo) 環境中執行此驗證的能力,因為我們無法假設每個開發人員都在 AWS 上工作。問題 設定heft-serverless-stack-tutorial 範例資料夾說明完整的專案設定。
CLI 參數
heft-serverless-stack-plugin/heft-plugin.json 定義這些參數
--sst
Invokes the SST postprocessing. Requires AWS credentials.
--sst-stage STAGE_NAME
Specifies the Serverless Stack stage; equivalent to
to the "--stage" parameter from the "sst" CLI