简体   繁体   English

如何在Lambda的AWS SAM模板中设置TTL?

[英]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/ Cloudformation具有此功能,您可以在其中设置TTL以触发删除堆栈的命令: 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? 有没有办法对AWS lambda SAM模板做类似的事情? I want some dev lambdas to be automatically deleted after an expiration period I set. 我希望某些dev lambda在设定的有效期限后自动删除。

AWS SAM is just syntactic sugar on top of CloudFormation. AWS SAM只是CloudFormation之上的语法糖。 You can use arbitrary CloudFormation resources in SAM templates as well, so the linked solution should work the same way when using SAM. 您也可以在SAM模板中使用任意CloudFormation资源,因此链接的解决方案在使用SAM时应以相同的方式工作。 Just include the linked CloudFormation template in your SAM template. 只需在您的SAM模板中包括链接的CloudFormation模板即可。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何设置模型以用于 SAM 模板中的 lambda 函数中的验证? - How do I set up a model to use for validation in a lambda function in a SAM template? 如何销毁 aws SAM Local lambda? - How do I destroy a aws SAM Local lambda? 如何使用 SAM 对 AWS Lambda 环境变量进行编码? - How do I code AWS Lambda env variables using SAM? 如何调用也在 AWS SAM 模板中定义的另一个 lambda 函数? - How can I invoke another lambda function also defined in AWS SAM template? 如何使用 AWS 代码部署而不使用 SAM 部署简单的 AWS lambda function? - How do i deploy a simple AWS lambda function using AWS code deploy without using SAM? SAM 模板中的 AWS AppConfig 验证 Lambda 策略 - AWS AppConfig Validation Lambda Policy in SAM Template AWS SAM/CloudFormation 模板 Lambda 删除保护 - AWS SAM/CloudFormation Template Lambda Delete Protection 运行 AWS SAM Local 时如何指定模板参数? - How do I specify template parameters when running AWS SAM Local? 运行本地 sam invoke 命令时,AWS lambda 函数找不到主应用程序。 如何让 sam invoke 找到 app.py 应用程序? - AWS lambda function does not find the main app when running a local sam invoke command. How do I make sam invoke find the app.py application? 如何将原始 CloudFormation 注入 AWS SAM templayte.yml ? 想要将 SQS FIFO 设置为 lambda 的事件源 - How do I inject raw CloudFormation into AWS SAM templayte.yml ? Want to setup SQS FIFO as event source for lambda
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM