@@ -199,18 +199,15 @@ public function runtime()
199199 }
200200
201201 /**
202- * The type of deployment package. Set to Image for container image and set Zip for .zip file archive.
202+ * The type of deployment package. Set to Image for container
203+ * image and set Zip for .zip file archive.
203204 *
204205 * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-lambda-2015-03-31.html#createfunction
205206 * @return string
206207 */
207208 public function packageType ()
208209 {
209- if ($ this ->handler () === Package::CONTAINER_HANDLER ) {
210- return Package::CONTAINER_HANDLER ;
211- }
212-
213- return 'Zip ' ;
210+ return $ this ->handler () === Package::CONTAINER_HANDLER ? 'Image ' : 'Zip ' ;
214211 }
215212
216213 /**
@@ -249,6 +246,7 @@ public function variables()
249246 * If your file lived in a folder called "lambda", you can just prepend the
250247 * path to your handler, leaving you with e.g. "lambda/image.generate".
251248 *
249+ * @see https://hammerstone.dev/sidecar/docs/main/functions/handlers-and-packages
252250 * @see https://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.Lambda.LambdaClient.html#_createFunction
253251 * @return string
254252 */
@@ -352,7 +350,10 @@ public function toDeploymentArray()
352350 'PackageType ' => $ this ->packageType (),
353351 ];
354352
355- if ($ this ->packageType () !== 'Zip ' ) {
353+ // For container image packages, we need to remove the Runtime
354+ // and Handler since the container handles both of those
355+ // things inherently.
356+ if ($ this ->packageType () === 'Image ' ) {
356357 $ config = Arr::except ($ config , ['Runtime ' , 'Handler ' ]);
357358 }
358359
0 commit comments