terraform-aws-lambda icon indicating copy to clipboard operation
terraform-aws-lambda copied to clipboard

feat: Add SAM Metadata resources to enable the integration with SAM CLI tool.

Open moelasmar opened this issue 3 years ago β€’ 6 comments

Description

This change is to add new resources (sam_metadata_*) of type (null_resource) that will maintain some information about the lambda resources exist in the terraform application to enable the integration with SAM CLI. SAM CLI tool is looking for the lambda resources source code, and the resources that contain the building logic of these resources. SAM CLI can use this information to extend the SAM CLI testing capabilities to the terraform applications.

Motivation and Context

This change will enable the customers who use Serverless TF module to define Lambda resources to integrate with SAM CLI tool, and so the customers can test their applications either locally or on cloud.

Breaking Changes

no breaking changes.

How Has This Been Tested?

  • [ ] I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • [X] I have tested and validated these changes using one or more of the provided examples/* projects As the new resource is just to collect metadata for SAM CLI tool, so it does not require any changes from the modules users side, and so no change in the examples. So I tested that I can run terraform apply for the available examples without any issues.
  • [X] I have executed pre-commit run -a on my pull request

moelasmar avatar Jul 08 '22 05:07 moelasmar

@bryantbiggs .. Could you please check this PR.

moelasmar avatar Jul 08 '22 05:07 moelasmar

Thanks @antonbabenko for your quick response. Regarding the Readme update, is it ok to add a new section regarding SAM CLI integration before the FAQ section in this Readme file

moelasmar avatar Jul 08 '22 12:07 moelasmar

@moelasmar I would put it under the How to deploy and manage Lambda functions

bryantbiggs avatar Jul 19 '22 11:07 bryantbiggs

@moelasmar I would put it under the How to deploy and manage Lambda functions

I founded that it is better to have a separate section for SAM CLI integration, as we plan to support testing only for now, and no plan to support package and deploy in the current project.

@antonbabenko, @bryantbiggs could you please have a look, and please let me know if you have any comments.

moelasmar avatar Jul 28 '22 21:07 moelasmar

Thanks @antonbabenko for your comment. Let me think more about it, also we can discuss it more in the meeting we have next week.

moelasmar avatar Aug 19 '22 20:08 moelasmar

Hi @moelasmar !

Thanks for your time and yesterday's discussion about this PR and SAM/TF integration.

If you don't mind, I'd like to keep this PR open until I can run SAM CLI locally myself and verify that it works as expected. It also doesn't look good for the users if we include SAM CLI commands in the docs, but users can't run them because SAM CLI doesn't have them available (not even in sam-nightly).

antonbabenko avatar Aug 24 '22 08:08 antonbabenko

Great work, @moelasmar !

antonbabenko avatar Nov 03 '22 10:11 antonbabenko

This PR is included in version 4.6.0 :tada:

antonbabenko avatar Nov 03 '22 10:11 antonbabenko

Thanks @antonbabenko for your support

moelasmar avatar Nov 03 '22 13:11 moelasmar

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Dec 04 '22 02:12 github-actions[bot]