简体   繁体   English

AWS SSM 文档自动化循环

[英]AWS SSM Document Automation loop

I am writing an AWS SSM Document Automation that will check resource status and send an email with report, so that a user can fix potential errors.我正在编写一个 AWS SSM Document Automation,它将检查资源状态并发送带有报告的 email,以便用户可以修复潜在错误。 The thing is I want document to wait for some time, check status again and if it's not valid then send an email again.问题是我希望文档等待一段时间,再次检查状态,如果它无效,则再次发送 email。

Document Steps:文件步骤:

  1. Check Status检查状态
  2. If valid - end, else go to step 3如果有效 - 结束,否则 go 到步骤 3
  3. Send email about not valid resource发送关于无效资源的 email
  4. Wait for X minutes等待 X 分钟
  5. Go back to Step 1 Go 返回步骤 1

Is it even possible to make a loop in AWS SSM Document Automation?甚至可以在 AWS SSM Document Automation 中创建一个循环吗? If it is, then how to manage its number of iterations?如果是,那么如何管理它的迭代次数? Can I modify initial input parameters values?我可以修改初始输入参数值吗?

I know that I can just invoke step functions and make a loop there(or just do everything step functions), but I want to avoid deploying more resources than necessary.我知道我可以只调用阶跃函数并在那里进行循环(或只执行所有阶跃函数),但我想避免部署不必要的资源。

in conclusion, SSM Document Automation does not provide loop.总之,SSM 文档自动化不提供循环。

but, you can make a conditional branching so you can do step 1, 2, 3, 5 .但是,您可以进行条件分支,以便执行第 1、2、3、5 step 1, 2, 3, 5 If you want to make wait for Xminutes, you should use aws:executeScript in Automation Document Action.如果您想等待 Xminutes,您应该在自动化文档操作中使用aws:executeScript

The most important thing is you can not go back to step 1. you should make the endpoint in the Document.最重要的是您不能 go 回到步骤 1。您应该在 Document 中制作端点。

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

相关问题 AWS Cloudformation SSM 自动化文档 | 与 aws cloudformation package 一起使用 - AWS Cloudformation SSM automation document | use with aws cloudformation package 我在哪里/如何在 AWS SSM 自动化文档中定义 NotificationConfig? - Where/how do I define a NotificationConfig in an AWS SSM Automation document? 如何每天执行 AWS SSM 自动化文档脚本? - How to execute AWS SSM automation document script daily? AWS-RunShellScript 中的 ssm 自动化文档输入不替换变量 - ssm automation document input in AWS-RunShellScript not substituting variable 在 AWS SSM 中运行 FOR 循环 - Running a FOR loop in AWS SSM 带有私人信息的AWS SSM文档 - AWS SSM document with private information 使用参数从 AWS SSM 自动化执行 Lambda - Execute Lambda from AWS SSM Automation with Parameters AWS SSM 自动化:如何在 aws:executeScript 调用的脚本中正常失败 - AWS SSM Automation: How to gracefully fail in script invoked by aws:executeScript SSM 自动化文档无法在 Lambda 调用结果上使用输出或 JSONPath - SSM Automation Document Unable to use Outputs or JSONPath on Lambda invoke results 如何使用 CloudFormation 创建具有 DocumentType 包的“AWS::SSM::Document” - How to create an 'AWS::SSM::Document' with DocumentType of Package using CloudFormation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM