顯示具有 Serverless 標籤的文章。 顯示所有文章
顯示具有 Serverless 標籤的文章。 顯示所有文章

2020年11月26日 星期四

Serverless

 最近做的 Serverless 概念的課程簡報

Serverless
 留言

開發工程必備的雲端架構知識

Paul Chen
DevOps @ 104 開發營運部

    


  • Serverless 由來
  • FaaS?SaaS?Serverless?
  • Serverless Architecture
  • Serverless Limits
  • Serverless Pros and Cons
  • Recap
  •  留言

Serverless 由來


Serverless Providers

  • AWS Lambda 
  • Microsoft Azure Function
  • Google Cloud Functions
  • IBM Cloud Functions

FaaS?SaaS?Serverless?

Note:

IaaS example: AWS EC2, OpenStack
PaaS example: Heroku, AWS Elastic Beanstalk
FaaS example: AWS Lambda
SaaS example: Gmail, Youtube, Office365, TravisCI


So… What is Serverless?


Serverless computing is a cloud computing execution model in which the cloud provider runs the server, and dynamically manages the allocation of machine resources. – Wiki


Function as a service (FaaS) is a category of cloud computing services that provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure. Building an application following this model is one way of achieving a “serverless” architecture. – Wiki


Serverless Architecture on AWS


The AWS serverless platform


The AWS serverless platform


Serverless Develop Limits

  • Functional Programming
  • Execution Duration
  • Stateless

Serverless Pros and Cons


Pros : Cost-effective


Pros : Scalability and Availability



Pros of Serverless

  • Cost-effective
  • Efficient scalability
  • High availability
  • Reduced operational costs
  • Focus on business, not on infrastructure

Serverless Cons

and how AWS can help


Cons of Serverless

  • Complex system architecture
    • Latency
    • Difficulty in debugging and running local test
  • Vendor lock-in

AWS X-Ray


AWS X-Ray Traces


Serverless Application Model (SAM)

$ sam build --use-container
$ sam local invoke -e event.json ExampleLambda

Recap

  • Serverless architecture have servers, but they are not managed by you
  • Functions are a core concept
  • Scaling and High Availability is done by cloud providers
  • Keeps cost low, by covering spikes and idle
  • Focus on business, not on infrastructure

End

2019年9月5日 星期四

AWS SAM (Serverless Application Mode) policy template occurred error

有用到 sam policy template 的時候,在 deploy 時 cloudformation 會需要 create role,這時就必須有 iam:createRole 權限,並且在 command line 加上 --capabilities CAPABILITY_IAM 參數,例如:
sam deploy --template-file packaged.yaml --stack-name example-stack --capabilities CAPABILITY_IAM
否則會出現這樣的錯誤
An error occurred (InsufficientCapabilitiesException) when calling the ExecuteChangeSet operation: Requires capabilities : [CAPABILITY_IAM]

Reference

This error is a security related message: it happens when you try to create
a CloudFormation stack that includes the creation of IAM related resources.
You have to explicitly tell CloudFormation that you are OK with that.