Getting this error when creating SSM document: invalidDocumentContent: YAML not well-formed.
This is the line below that the error references "$version = '6.18'",
I get the same error on other lines in the new block, so if I can figure out this line, I can figure out the rest too.
I cloned a working SSM document and put this block of code in. The document works fine besides this block. I'm just perplexed, and I am sure this is due to my inexperience and the answer is simple and I will feel stupid when it's revealed...
Document:
{
"schemaVersion": "2.2",
"description": "X",
"parameters": {},
"mainSteps": [
{
"action": "aws:runPowerShellScript",
"name": "dbaCustomizations",
"precondition": {
"StringEquals": [
"platformType",
"Windows"
]
},
"inputs": {
"runCommand": [
"$errorActionPreference = 'stop'",
"try {",
"$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'",
"[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols",
"Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\.NetFramework\\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord",
"Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\.NetFramework\\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord",
"",
"# PG admin separately for the ALLUSERS flag for now. ",
"$version = '6.18'",
"$output = [string]::Format('C:\pgadmin4-{0}-x64.exe',$version)",
"$url = [string]::Format('https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v{0}/windows/pgadmin4-{0}-x64.exe',$version)",
"(New-Object Net.WebClient).DownloadFile($url, $output)",
"Start-Process -Wait -FilePath $output -ArgumentList '/ALLUSERS /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -PassThru",
"}",
"} catch",
"{",
" Write-Output \"Error encountered \" + $Error[0].Exception.Message",
" exit 1",
"}",
""
],
"timeoutSeconds": 7200
}
}
]
}