How do I set a TTL in an AWS SAM template for lambda?


How do I set a TTL in an AWS SAM template for lambda?



Cloudformation has this feature where you can set a TTL which triggers a command that deletes the stack: https://aws.amazon.com/blogs/devops/scheduling-automatic-deletion-of-application-environments/



Is there a way to do something similar with AWS lambda SAM template? I want some dev lambdas to be automatically deleted after an expiration period I set.




1 Answer
1



AWS SAM is just syntactic sugar on top of CloudFormation. You can use arbitrary CloudFormation resources in SAM templates as well, so the linked solution should work the same way when using SAM. Just include the linked CloudFormation template in your SAM template.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API