多功能SAM模板的推荐项目结构 [英] Recommended Project Structure for multi-function SAM Template

查看:160
本文介绍了多功能SAM模板的推荐项目结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新项目,该项目需要相对较少的服务,也许不超过10个(因此,将每个服务放在单独的项目存储库中是不经济的).每个服务将通过SAM模板定义为AWS :: Serverless :: Function.我的问题是:组织或组织此类项目的推荐方法是什么?

I have a new project that requires a relatively small amount of services, maybe 10 or less (and therefore it is not economical to place each in a separate project repository). Each service will be defined as an AWS::Serverless::Function via SAM Template. My question is: what is the recommended way to organize or structure such a project?

当前结构为:

|- src
    |- lambdas
        |- service-one
            |- stuff
            |- package.json
        |- service-two
            |- stuff
            |- package.json
    |- other-stuff
|- test
|- package.json

是否有办法避免每个lambda用作具有唯一package.json等的自己的子项目?

Is there a way to avoid having each lambda act as its own sub-project with unique package.json and etc?

推荐答案

我已经设计了项目结构,如下所示

I have designed the structure of my project like below

ProjectName
├── dependencies
│   └── package-pandas-requests.zip
├── deploy.sh
├── infrastructure
│   ├── packaged.yaml
│   └── template.yaml
└── src
    └── lambdas
        ├── lambdafunction1
        │   └── app.py
        ├── lambdafunction2
        │   └── app.py
        ├── lambdafunction3
        │   └── app.py

依赖项是分层包 SAM框架的yaml文件的基础结构 希望这能消除您的疑问.

dependencies are layers package infrastructure for yaml files of SAM framework Hope this will clear your doubt.

这篇关于多功能SAM模板的推荐项目结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆