You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Yes. AWS SAM CLI works, but AWS Toolkit doesn't.
Directly using the AWS SAM CLI works for local execution of Lambda functions created from CDK as described in docs. However, with the AWS Toolkit for PyCharm (both Community and Professional) doesn't work.
The AWS Toolkit UI doesn't even recognize templates that are not in YAML format (if you open the cdk.out folder nothing is listed if there are only JSONs). Additionally, there seems to be validations in the template that forces us to use AWS SAM specification (i.e. native AWS CloudFormation specification is marked as invalid template, and throws errors like "Code property is invalid").
I'm able to make it work, but manual changes are needed. When I create serverless resources (e.g. Lambda functions) the cdk.out directory outputs JSON template for the compiled CloudFormation. To be able to work with AWS Toolkit for PyCharm and debug functions locally I need to perform 2 steps:
convert template.json to template.yml
modify the desired Lambda resource to follow strictly the AWS SAM specification. For example, i. change resource type from "Type: AWS::Lambda::Function" to "Type: AWS::Serverless::Function", ii. comment "Code" property, iii. add Metadata tags expected from AWS Toolkit (not AWS SAM), like "Dockerfile", "DockerContext".
Again, to make sure I'm being clear, if I run "sam local invoke -t template.json" works without any changes (no need to comment the "Code" property, modify the "Metadata", etc.). This is only needed when AWS Toolkit runs the SAM commands for us.
Describe the solution you'd like
AWS Toolkit for Jetbrains should be compatible with AWS SAM. Hence, it should support CloudFormation templates in JSON format and also support native CloudFormation syntax just like the AWS SAM CLI does.
Describe alternatives you've considered
Implementing this temporary workaround described, with the 2 manual steps.
The problem is that everytime that CDK code is compiled into CloudFormation, we need to perform the 2 steps. That's not scalable.
Additional context
None
The text was updated successfully, but these errors were encountered:
marcelokscunha
changed the title
Improve/fix integratation between CDK with AWS SAM for local debugging
Improve/fix integration between CDK with AWS SAM for local debugging
Nov 8, 2024
Is your feature request related to a problem? Please describe.
Yes. AWS SAM CLI works, but AWS Toolkit doesn't.
Directly using the AWS SAM CLI works for local execution of Lambda functions created from CDK as described in docs. However, with the AWS Toolkit for PyCharm (both Community and Professional) doesn't work.
The AWS Toolkit UI doesn't even recognize templates that are not in YAML format (if you open the cdk.out folder nothing is listed if there are only JSONs). Additionally, there seems to be validations in the template that forces us to use AWS SAM specification (i.e. native AWS CloudFormation specification is marked as invalid template, and throws errors like "Code property is invalid").
I'm able to make it work, but manual changes are needed. When I create serverless resources (e.g. Lambda functions) the cdk.out directory outputs JSON template for the compiled CloudFormation. To be able to work with AWS Toolkit for PyCharm and debug functions locally I need to perform 2 steps:
Again, to make sure I'm being clear, if I run "sam local invoke -t template.json" works without any changes (no need to comment the "Code" property, modify the "Metadata", etc.). This is only needed when AWS Toolkit runs the SAM commands for us.
Describe the solution you'd like
AWS Toolkit for Jetbrains should be compatible with AWS SAM. Hence, it should support CloudFormation templates in JSON format and also support native CloudFormation syntax just like the AWS SAM CLI does.
Describe alternatives you've considered
Implementing this temporary workaround described, with the 2 manual steps.
The problem is that everytime that CDK code is compiled into CloudFormation, we need to perform the 2 steps. That's not scalable.
Additional context
None
The text was updated successfully, but these errors were encountered: