老布這麼說
Yet another bootstrap theme.
2021-12-02
Read More
2021-12-02
在 deploy aws 架構時,使用 terraform 是滿好的 IaC 方式,在這次的 project 中,想嘗試看看
因為這次嘗試的 aws service 較多,用 terraform 的方式,是屬於 deploy 進階部分,先將 google 到的資料記錄起來
待完成目前的 job 後,再來看看如何自動化
Reference
待完成目前的 job 後,再來看看如何自動化
Reference
- AWS Step Functions workflow for an ETL Job on COVID-19 and deploying it with Terraform (#CloudGuruChallenge Series) (Part 2/3) - DEV Community
- amazon web services - How to use Terraform to define cloundwatch event rules to trigger StepFunction statemachine - Stack Overflow 要用 Event Bridge (cloudwatch event) 來 trigger Step Function 需要自行增加的 iam_role 設定
2021-12-01
由 S3 trigger 到 step function 需要經過一個 event 的步驟,目前測試出來的方式為
- S3 設定送給 Event Bridge
- 設定 Event Bridge rule
- Event Bridge 送給 step function
Reference
- Tutorial: Log Amazon S3 object-level operations using EventBridge - Amazon EventBridge
- Trigger an ECS job when an S3 upload completes | by Maxime Bury | Medium
- Starting a State Machine Execution in Response to Amazon S3 Events - AWS Step Functions 範例中是用 AWS CloudTrail 為中介,實作上是改用 Event Bridge 來做
- New – Use Amazon S3 Event Notifications with Amazon EventBridge | Noise 參考這篇,微調後進行的設定
- AWS EventBridge vs S3 Notification - DEV Community
- terraform EventBridge
進階參考
2021-11-19
最近工作上需要用到 step function,趁此機會來試試這一個 plugin 如何使用
Reference
- serverless-operations/serverless-step-functions: AWS Step Functions plugin for Serverless Framework ⚡️ - AWS Step Functions plugin for Serverless Framework
2021-11-19
Read More
2021-11-19
在使用 api gateway 搭配 lambda 的情形中,常會遇到前端用同一組 custom domain name,不過後端需要介接不同的 serverless lambda project
目前我的作法是將 ApiGatewayRestApi & RootResourceId share 出來,提供給不同的 lambda project 使用
Reference
- Share API Gateway and API Resources 官方說明
- How to share an API domain between services in a monorepo Serverless app 滿完整的兩種做法介紹,目前是以 Method 2: Single API Gateway Project 方式來實作
- Shared API Gateway (2017-11-11)
2021-11-12
Read More
2021-11-12
在使用 terraform 來架設 multiple stage 環境時,terraform 官方是建議使用 workapce 來進行
Reference
- Managing Workspaces - Terraform CLI - Terraform by HashiCorp 官方說明 workspace 的文件
- 今晚我想創造 Terraform 工作空間 workspace - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天 主要參考這份文件來進行
- 今晚我想管理多個環境下的 Terraform 檔案 - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天
- Terraform variables and state across environments and workspaces
- How to use Terraform workspaces to manage environment-based configuration - Binx - 覺得這篇是滿完整的作法,不過對於 module 還不是很熟悉如何搭配,另外沒有完整的 source code 可以參考,暫時沒有依照這篇的建議進行
- How to Create Terraform Multiple Environments 有時間要來研究、研究
同場加映 - terraform 基本介紹
2021-11-11
如何透過 api-gateway 將檔案上傳到 S3
Reference
- Hit the 6MB Lambda payload limit? Here’s what you can do. | theburningmonk.com - 參考 Option 1: use API Gateway service proxy
- S3 Uploads — Proxies vs Presigned URLs vs Presigned POSTs | by Zac Charles | Medium
- serverless-operations/serverless-apigateway-service-proxy: This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway. - This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway.
- Tutorial: Create a REST API as an Amazon S3 proxy in API Gateway - Amazon API Gateway 官方文件, 手動的作法參考
其他 search 到的一些記錄
2021-11-09
使用 api-gateway 來當 proxy 的方式,設定 integrationi type 為 HTTP_PROXY
需要設定 AWS::ApiGateway::Resource
& AWS::ApiGateway::Method
,當設定的 url 為多層的 (包含多個 / 的 path),需要設定多組 AWS::ApiGateway::Resource
serverless framework plugin
- serverless-operations/serverless-apigateway-service-proxy: This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway. - This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway.
Reference
- Setting an HTTP Proxy on API Gateway serverless framework 說明文件
- Tutorial: Build a REST API with HTTP proxy integration - Amazon API Gateway ** 手動建立的文件,可以先用這份來嘗試
- Build an API with HTTP Proxy via Serverless | by Kithmal Warnasooriya | Medium 主要參考文章
- Setting an HTTP Proxy on API Gateway by using Serverless framework. 主要參考文章
- Working with routes for HTTP APIs - Amazon API Gateway routing 的順序
- Amazon API Gateway: Explaining HTTP Proxy in HTTP API | by Jaewoo Ahn | Sep, 2021 | Medium
同場加映
- ServerlessOperations 在看 apigateway service proxy 時,有看到是這家日本公司開發的 project,來加以關注囉