Skip to content

serverless.template file sometimes changes package type to Zip from Image #333

@benny-yamagata

Description

@benny-yamagata

Describe the bug

Occasionally, after building the function locally I will notice a change in my source control tab in VS code for the serverless.template file. It will have changed my package type from image to zip and added additional fields to support it.

Nowhere else in my project is the word zip found, I'm wondering if this is some background process?

Expected Behavior

serverless.template does not change package type.

Current Behavior

serverless.template sometimes changes package type from image to zip. (does not happen the other way around)

Reproduction Steps

  1. dotnet new serverless.annotations
  2. Replace Functions.cs with the following:
/// <summary>
/// A collection of sample Lambda functions that provide a REST api for doing simple math calculations. 
/// </summary>
public class Functions
{
    [LambdaFunction()]
    public void ProcessDynamoDbEvent(DynamoDBEvent dynamoEvent, ILambdaContext context)
    {
        context.Logger.LogInformation("Processing event");
    
  1. Update serverless.template file to change PackageType to Image
  2. Add new class to bottom of Functions.cs
  3. Build the project

Possible Solution

No response

Additional Information/Context

No response

Targeted .NET platform

.net8

CLI extension version

Package Id                                     Version         Commands
----------------------------------------------------------------------------------------
amazon.lambda.tools                            5.9.0           dotnet-lambda

Environment details (OS name and version, etc.)

OSX Sonoma 14.6.1

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.module/cli-extp2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions