AWS Systems Manger文档如何在脚本中引用字符串列表类型

问题描述

在AWS Systems Manager中,我试图创建一个Command Document并尝试传递stringlist类型的参数,但是我将如何在脚本中引用它。

---
schemaVersion: "2.2"
description: "Command Document Example JSON Template"
parameters:
  testlist:
    type: StringList
  teststring:
    type: String
mainSteps:
- action: "aws:runShellScript"
  name: "file"
  inputs:
    runcommand:
    - "#!/usr/bin/env bash"
    - "val1=\"{{testlist[0]}}\""
    - "val2=\"{{teststring}}\""
    - "echo ${val1}"
    - "echo ${val2}"

当我针对testlist运行此文件时,我通过了test1,test2,对于teststring我通过了test3输出,如下所示:

{{testlist [0]}}

test3

如何在脚本中引用StringList?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)