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
Copy file name to clipboardExpand all lines: README.md
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -83,10 +83,14 @@ When `serverless deploy` is run, the plugin will:
83
83
The Serverless framework will then pickup each zip file and upload it to your provider.
84
84
85
85
Here's a simple `serverless.yml` configuration for this plugin, assuming the project structure above
86
+
one of the functions we add `-${opt:stage}` to the name in order to append the stage to the function name
86
87
87
88
```
88
89
service: your-awesome-project
89
90
91
+
package:
92
+
individually: true
93
+
90
94
plugins:
91
95
- serverless-package-python-functions
92
96
@@ -102,7 +106,7 @@ custom:
102
106
103
107
functions:
104
108
function1:
105
-
name: function1
109
+
name: function1-${opt:stage}
106
110
handler: lambda.handler
107
111
package:
108
112
include:
@@ -135,6 +139,9 @@ At the function level, you:
135
139
- Use `include` to specify what function-level files you want to include in your artifact. Simply specifying the path to the function's folder will include every file in the folder in the function's zip artifact
136
140
- Use `artifact` to tell Serverless where to find the zip artifact. The plugin creates the zip artifact for the function at `buildDir`/`name`.zip, so using `${self:custom.pkgPyFuncs.buildDir}/[function-name-here].zip` is advised.
137
141
142
+
At the package level, you may need to:
143
+
- Specify the `individually` parameter as `true` to ensure that zip artifacts are generated properly. You may need this if you are getting file not found errors about your zip artifact.
144
+
138
145
Now, you may be wondering, doesn't the [Serverless documentation say](https://serverless.com/framework/docs/providers/aws/guide/packaging#artifact):
139
146
> Serverless won't zip your service if [artifact] is configured and therefore exclude and include will be ignored. Either you use artifact or include / exclude.
0 commit comments