'aws Download Content in Yaml
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"
Solution 1:[1]
Posting JSON example as well, as we struggled to find examples in json that worked. Hoping this will help someone in the future.
Our error was related to "sourceInfo" key:
> invalid format in plugin properties map[destinationPath:C:\PATHONTARGETSYSTEM sourceInfo:map[path:https://S3BUCKETNAME.s3.amazonaws.com/SCRIPTNAME.ps1] sourceType:S3]; error json: cannot unmarshal object into Go struct field DownloadContentPlugin.sourceInfo of type string
Solution was ultimately the wrong S3 url format + the wrong json formatting. Should look like so:
"sourceInfo": "{\"path\": \"https://s3.amazonaws.com/S3BUCKETNAME/SCRIPTNAME.ps1\"}",
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eli Brown |
