【发布时间】:2022-02-11 03:06:29
【问题描述】:
我们有许多无服务器服务。他们中的许多人共享一些属性。以下是他们分享的部分内容:
// shared.yaml
frameworkVersion: '3'
configValidationMode: error
plugins:
modules:
- serverless-prune-plugin
- serverless-deployment-bucket
custom:
sharedHost: ${file(./shared-host.config.js)}
prune:
automatic: true
number: 2
Outputs:
UserInformation:
Value: ${self:custom.sharedHost.userId}
Description: ${self:custom.sharedHost.userArn}
GitInformation:
Value: ${self:custom.sharedHost.gitId}
Description: ${self:custom.sharedHost.gitDescription}
是否可以用一行将这些属性添加到serverless.yaml 文件中?
我正在寻找类似的东西:
// services/some-service/serverless.yaml
service: SomeService
join: ${file(../../shared.yaml)}
custom:
someProp: someValue
我在问题中添加了json 标签,因为我认为如果使用无服务器或 yaml 功能无法做到这一点,那么也许可以使用一些 json 功能。
【问题讨论】:
标签: json yaml serverless-framework