【问题标题】:How to read ssm parameters in a shell script in aws data pipeline?如何在 aws 数据管道的 shell 脚本中读取 ssm 参数?
【发布时间】:2020-10-08 18:41:13
【问题描述】:

我正在 aws 中设置数据管道。并计划使用“开始使用 ShellCommandActivity”模板来运行 shell 脚本。如何将存储在 ssm 参数中的凭据作为参数传递给此脚本。

【问题讨论】:

    标签: amazon-web-services aws-data-pipeline


    【解决方案1】:

    我还没有验证,但据我所知,ShellCommandActivityShellScriptConfig 相似。根据为这些命令提供的示例,我认为您可以按如下方式传递 ssm 参数名称:

    {
      "id" : "CreateDirectory",
      "type" : "ShellCommandActivity",
      "command" : "your-script.sh <name-of-your-parameter>"
    }
    

    {
      "id" : "CreateDirectory",
      "type" : "ShellCommandActivity",
      "scriptUri" : "s3://my-bucket/example.sh",
      "scriptArgument" : ["<name-of-your-parameter>"]
    }
    

    example.sh 中,您将使用$1 来引用传递的参数的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-19
      • 1970-01-01
      • 2020-08-27
      • 2020-03-18
      相关资源
      最近更新 更多