You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
In order to define a value in one serverless.yml that can be used in another serverless.yml (to avoid copy-paste and synchronization problems), I must define the variable in a way that can render to the same concrete string from the context of multiple projects. To do this, both projects must define a custom.uniquePropery that references the top-level of the referred-to-project.
In retail-stream/serverless.yml many custom.export* values are defined that I want to use in both products/lambda/serverless.yml and product-catalog/serverless.yml without copy-pasting the value.
custom:
stage: ${opt:stage, self:provider.stage, self:custom.private.stage}
private: ${file(../private.yml)}
helloRetail: ${file(../helloRetail.yml)}
retailStreamVersion: 1 # The version of this service to depend upon
retailStream: ${self:} # externally, use `${file(~/retail-stream/serverless.yml)}`, replacing the `~` therein with the appropriate relative reference [e.g. '..' or '../..']
exportRetailStreamArn: ${self:custom.retailStream.service}:${self:custom.stage}:RetailStreamArn:${self:custom.retailStreamVersion}
Because of this pattern, the custom.export* values render to equivalent values in all projects.
Activity