terraform-aws-lambda
terraform-aws-lambda copied to clipboard
feat: Add SAM Metadata resources to enable the integration with SAM CLI tool.
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 runterraform applyfor the available examples without any issues. - [X] I have executed
pre-commit run -aon my pull request
@bryantbiggs .. Could you please check this PR.
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 I would put it under the How to deploy and manage Lambda functions
@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.
Thanks @antonbabenko for your comment. Let me think more about it, also we can discuss it more in the meeting we have next week.
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).
Great work, @moelasmar !
This PR is included in version 4.6.0 :tada:
Thanks @antonbabenko for your support
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.