Sample Systems Manager Document for Deploying an Alchemy Compatibility Package to AWS

Save to PDF

Applies to: Alchemy

30/09/2022 Cliff Hobbs   ID: 342863

Below is a sample Systems Management document that can be used as the basis to create a new document to deploy a Cloudhouse Alchemy Compatibility Package to Amazon Web Services (AWS).

{
 "schemaVersion": "2.2",
 "description": "Execute scripts stored in a remote location. The following remote locations are currently supported: GitHub (public and private) and Amazon S3 (S3). The following script types are currently supported: #! support on Linux and file associations on Windows.",
   "parameters": {
   "sourceType": {
   "description": "(Required) Specify the source type; either S3 or GitHub.",
   "type": "String",
   "allowedValues": [
     "GitHub",
     "S3"
   ]
 },
 "sourceInfo": {
   "description": "(Required) Specify the information required to access the resource from the source. If source type is GitHub, then you can specify any of the following: 'owner', 'repository', 'path', 'getOptions', 'tokenInfo'. If source type is S3, then you can specify 'path'.",
   "type": "StringMap",
   "displayType": "textarea",
   "default": {}
 },
 "sourceZIP": {
   "description": "(Required) Specify the information required to access the ZIP from the source. If source type is GitHub, then you can specify any of the following: 'owner', 'repository', 'path', 'getOptions', 'tokenInfo'. If source type is S3, then you can specify 'path'.",
   "type": "StringMap",
   "displayType": "textarea",
   "default": {}
 },
 "commandLine": {
   "description": "(Required) Specify the command line to be executed. The following formats of commands can be run: 'DeployZippedContainer.ps1 -sourcezip ContainerName.zip -deploycmd Cloudhouse.Container.Deploy.exe -deployargs '/deploydir c:\\programdata /deploytype user /acceptEULA'",
   "type": "String",
   "default": ""
 },
 "workingDirectory": {
   "type": "String",
   "default": "c:\\temp",
   "description": "(Optional) The path where the content will be downloaded and executed from on your instance.",
   "maxChars": 4096
 },
 "executionTimeout": {
     "description": "(Optional) The time in seconds for a command to complete before it is considered to have failed. Default is 1800 (30 mins). Maximum is 28800 (8 hours).", 
     "type": "String",
     "default": "1800",
     "allowedPattern": "([1-9][0-9]{0,3})|(1[0-9]{1,4})|(2[0-7][0-9]{1,3})|(28[0-7][0-9]{1,2})|(28800)"
 }
},
"mainSteps": [
  {
    "precondition": {
      "StringEquals": [
      "platformType",
      "Windows"
     ]
  },
  "action": "aws:downloadContent",
  "name": "downloadContent",
  "inputs": {
     "sourceType": "{{ sourceType }}",
     "sourceInfo": "{{ sourceInfo }}",
     "destinationPath": "{{ workingDirectory }}"
     }
  },
{
   "precondition": {
   "StringEquals": [
     "platformType",
     "Windows"
     ]
   },
    "action": "aws:downloadContent",
    "name": "downloadContainter",
    "inputs": {
       "sourceType": "{{ sourceType }}",
       "sourceInfo": "{{ sourceZIP }}",
       "destinationPath": "{{ workingDirectory }}"
    }
},
{
    "precondition": {
    "StringEquals": [
        "platformType",
        "Windows"
        ]
    },
    "action": "aws:runPowerShellScript",
    "name": "runPowerShellScript",
    "inputs": {
        "runCommand": [
        "",
        "$directory = Convert-Path .",
        "$env:PATH += \";$directory\"",
        " {{ commandLine }}",
        "if ($?) {",
        "    exit $LASTEXITCODE",
        "} else {",
        "    exit 255",
        "}",
        ""
    ],
    "workingDirectory": "{{ workingDirectory }}",
    "timeoutSeconds": "{{ executionTimeout }}"
    }
    }
    ]
}
Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support