简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM