Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS SAM - 'Encountered unsupported property CodeUri' error when deploying packaged template

After migrating a CloudFormation template to AWS SAM approach, when deploying template created with aws cloudformation package, in CloudFormation I get error

Encountered unsupported property CodeUri

on all Lambda functions that are included in the template.

After investigation, it's clear that CodeUri property is not removed from the packaged template and AWS::Lambda::Function type doesn't support CodeUri property, although proper resources are uploaded to S3 as part of the package process (so package as such works).

like image 786
Lech Migdal Avatar asked Aug 29 '18 10:08

Lech Migdal


1 Answers

The reason for AWS SAM not removing CodeUri is incorrect resource type - it should be AWS::Serverless::Function and not AWS::Lambda::Function.

After this change, CodeUri is removed from the packaged template.

like image 191
Lech Migdal Avatar answered Oct 21 '22 04:10

Lech Migdal