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
{{ message }}
Repository navigation
Question: How do references to other components' output work? #16
This is a more general question about working with Serverless Components, not necessarily specific to this repo. If there's a better place to post this, let me know.
The API component in this repo references output from the permissions and database components. How does that work?
component: expressapp: fullstackname: apiinputs:
# Express application source code.src: ./# Permissions required for the AWS Lambda function to interact with other resourcesroleName: ${output:permissions.name} # <<--- _HOW_ does this work??
AFAICT, the only linkages between the API component and the permissions component are the app values, and directory structure (api/ and permissions/ being siblings).
I'm trying to add a layer to a lambda using those conventions—sibling directories, same app values—but I keep getting invalid reference ${output:commoncode.arnVersion}. What am I missing? How do these output references work?
Similarly, if you run serverless deploy in the root folder, how does it know the dependency graph to define the order of operations in which to deploy? I.e. the database must be deployed prior to the api etc.
This would find the instance named instanceName in the same app & stage you're deploying to. So in your case, the instance name is permissions. You can confirm that by looking at the name property of the yaml file inside the permissions folder.
@tommedema the CLI collects all the yaml files in child directories and does some basic static analysis, to figure out the output references.
Activity
tommedema commentedon Nov 9, 2020
Same question here.
Similarly, if you run serverless deploy in the root folder, how does it know the dependency graph to define the order of operations in which to deploy? I.e. the database must be deployed prior to the api etc.
eahefnawy commentedon Jan 4, 2021
The output variable format is like this:
This would find the instance named
instanceNamein the same app & stage you're deploying to. So in your case, the instance name ispermissions. You can confirm that by looking at thenameproperty of the yaml file inside the permissions folder.@tommedema the CLI collects all the yaml files in child directories and does some basic static analysis, to figure out the output references.
tommedema commentedon Jan 4, 2021
@eahefnawy does it then do a graph analysis to ensure that dependencies are deployed prior to dependents etc.?