-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuring the paths to include in serverless.Functions #210
Conversation
An `aws.serverless.Function` can now accept a list of include paths, which will be included inside the Lambda package along with the generated `__index.js` file Also changes the default from '.' to './node_modules', so that the very common case of changes to the root folder do not trigger changes to the code for lambdas. If files from the local folder are needed by the lambda, they can be included in the `includePaths` parameter. Also adds support for providing a pre-created Role instead of just Policies, to support scenarios where users want to pre-create or share a Role across multiple functions. Fixes #35.
Merging, but happy to address any feedback in follow-up. @CyrusNajmabadi @pgavlin. |
🙌 My only feedback is that it'd be nice to have an |
I have to admit, I don't understand our end game for this work. We seem to be moving in a direction of treating each lambda as though it is its own distinct "application," and I have a hard time keeping track in my head what will work and what will not work. For instance, I fear the simple case of
will now stop working, because I can't possibly know the full transitive set of imports those routes will need. It's just not clear yet to me how this will surface in the This is more like how most other solutions treat lambdas, but this is a place where Pulumi has historically intentionally been different. We encourage people to mix runtime and infrastructure code freely. I worry that us not letting you share imports, plus not even easily sharing files, will mix poorly with the fact that we're encouraging you to put all your code into shared files. In short, either there's something I'm just completely misunderstanding about where we think all of this will settle, or I'm increasingly nervous about continuing in this direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Thanks for doing this.
The breaking change in #210 casues this test to fail because we no longer upload everything in the lambda context that we did before. Until we can fix up this test, just disable it.
An
aws.serverless.Function
can now accept a list of include paths, which will be included inside the Lambda package along with the generated__index.js
fileAlso changes the default from '.' to './node_modules', so that the very common case of changes to the root folder do not trigger changes to the code for lambdas. If files from the local folder are needed by the lambda, they can be included in the
includePaths
parameter.Also adds support for providing a pre-created Role instead of just Policies, to support scenarios where users want to pre-create or share a Role across multiple functions.
Part of #35.