title: Change lambda from supported runtime to docker image
body: <p>I have a lambda which was created and deployed with CloudFormation. The lambda, as of now, uses the supported .NET Core 3.1 runtime but I want to use the &quot;unsupported&quot; .Net Core 5 so I have created a Docker image <a href="https://aws.amazon.com/blogs/compute/using-container-image-support-for-aws-lambda-with-aws-sam/" rel="noreferrer">which the lambda can run</a>.</p>
  <p>The problem I have is that CloudFormation can't seem to change the lambda from running a supported runtime to running a Docker image. I get <code>Please don't provide ImageUri when updating a function with packageType Zip.</code> when updating the CloudFormation stack with the updated template.</p>
  <p>This is how my CloudFormation template looks like:</p>
  <pre class="lang-yaml prettyprint-override"><code>MyFunction:
      Type: &quot;AWS::Serverless::Function&quot;
      Properties:
          PackageType: Image
          ImageUri: &lt;uri-to-ecr-docker-image&gt;
          ...
      Metadata:
          Dockerfile: Dockerfile
          DockerContext: .
          DockerTag: v1
  </code></pre>
  <p>Any ideas on how to solve this?</p>