AWS Lambda CloudFormation - The first sight

用Cloudformation deploy AWS lambda function有兩種方式,AWS::Serverless::Function and AWS::Lambda::Function

名詞解釋:AWS Serverless Stack - A combination of AWS offered serverless technologies including API-Gateway, Lambda, S3, etc.
因為複雜性使得在寫以上這些服務的Cloudformation 有挑戰,例如config繁多以及service dependency。

AWS::Serverless::Function 的SAM (Serverless Application Model) syntax是基於Serverless framework - open source devops template 去簡化deploy API-Gateway 跟 Lambda這種的serverless服務。最簡單的例子就是可以在建立一個lambda function同時,也能夠在同一個Cloudformation resource section中把相對應的 Lambda execution IAM role也建立出來。

而AWS::Lambda::Function則是一般Cloudformation建立Lambda的寫法,需要自己關聯Lambda execution role、 打包package 到自己定義的s3 bucket存放artifact等,隨後在下指令去s3拉檔案deploy。

留言

這個網誌中的熱門文章

[專案] 銀行端末系統

如何在MacOS 中自由切換不同Python版本 - pyenv + virtualenv

用 C# 控制 Win7 輸入法