【发布时间】:2019-10-16 15:49:14
【问题描述】:
我使用 AWS Step Functions 编写了一项服务。我想将其集成到我们现有的 Elastic Beanstalk 开发过程中的应用程序中,其中我们有不同的开发、暂存和生产应用程序。这些阶段中的每一个都有特定于应用程序的环境变量,我也想将其引入我的 Lambda 函数中。
我目前没有使用 SAM,但如有必要,我可以移植来完成此操作。
以下是我的 serverless.yml 文件的简化配置。
service:
name: small-service
plugins:
- serverless-webpack
- serverless-step-functions
- serverless-pseudo-parameters
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: us-east-2
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource: { "Fn::Join": ["", ["arn:aws:s3:::S3-bucket-name", "/*" ] ] }
functions:
connect:
handler: handler.connect
stepFunctions:
stateMachines:
smallService:
name: small-service-${self:provider.stage}
definition:
Comment: Service that connects to things
StartAt: Connect
States:
Connect:
Type: Task
Resource: arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:${self:service}-${self:provider.stage}-connect
End: true
如何将 step 函数动态部署到不同的 beanstalk 应用程序中?如何从 Step Functions 中访问 ElasticBeanstalk 环境属性?
有没有更好的方法将环境 .env 变量动态导入 EB 之外的无服务器应用程序?我们正在将该服务集成到更大的 AWS 应用程序开发工作流程中,是否有更“无服务器”的方式来做到这一点?
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-elastic-beanstalk serverless aws-step-functions