aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
749 stars 216 forks source link

Template for deploying Serverless::Lambda fails when not using Serverless transform #3237

Open crichey opened 2 years ago

crichey commented 2 years ago

When deploying a lambda, the template fails to deploy via sam with the error: Unrecognized resource types: [AWS::Serverless::Function].

Template that is created is (redacted): `Resources: Function: Type: AWS::Serverless::Function Properties: Timeout: 300 MemorySize: 128 Handler: helloworld.App CodeUri: s3://.....redacted Runtime: java11 Architectures:

Adding this header manually seems to solve the problem: AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31'

rli commented 2 years ago

I thought this was pretty well documented by CloudFormation, but it would be nice to have hints in the IDE when you try to use a AWS::Serverless resource without the appropriate transform declared

crichey commented 2 years ago

Definitely some sort of hint or option to add that. The default path is to just select "create new aws lambda" from the Lambda menu and that leads to a template that isn't properly formed for deployment.

crichey commented 1 year ago

Yes along with some clear way to change how the template is created. If the plug-in creates a template automatically it should use the right settings.

Sent from my iPhone

On Aug 2, 2022, at 12:40, Richard Li @.***> wrote:

 I thought this was pretty well documented by CloudFormation, but it would be nice to have hints in the IDE when you try to use a AWS::Serverless resource without the appropriate transform declared

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.