微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。