aws Download Content in Yaml

霸气de小男生 提交于 2021-02-10 14:37:03

问题


Trying to format my yaml to download a script in S3 bucket to run in SSM.

I've tried many different formats, but all examples seem to be JSON formatted

- action: aws:downloadContent
  name: downloadContent
  inputs:
    sourceType: "S3"
    sourceInfo: 
      path: https://bucket-name.s3.amazonaws.com/scripts/script.ps1
    destinationPath: "C:\\Windows\\Temp"

Fails with the following message:

standardError": "invalid format in plugin properties map[destinationPath:C:\\Windows\\Temp sourceInfo:map[path:https://bucket-name.s3.amazonaws.com/scripts/script.ps1] sourceType:S3]; \nerror json: cannot unmarshal object into Go struct field DownloadContentPlugin.sourceInfo of type string"

回答1:


This is what ended up working for me:

    - action: aws:downloadContent
      name: downloadContent
      inputs:
        sourceType: S3
        sourceInfo: "{\"path\":\"https://bucket-name.s3.amazonaws.com/scripts/script.ps1\"}"
      destinationPath: "C:\\Windows\\Temp"

I needed that exact JSON syntax embedded in the YAML.



来源:https://stackoverflow.com/questions/57330403/aws-download-content-in-yaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!