發表文章

目前顯示的是有「CloudFormation」標籤的文章

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。 https://stackoverflow.com/questions/49953270/what-is-the-difference-between-a-serverless-function-and-a-lambda-function