问题
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