Is there a way to automate creating the next asgard auto scaling group? I have the AMI image ID I want to deploy with. I poked around their API and it doesn't seem clear to me how this can be done. Does anyone have any suggestions?
For anyone coming here I've solved this using some simple shell scripts. You can wrap this up in any REST api or language you want, but the gist is
function asgard(){
verb=$1
url="https://my.asgard.com/us-east-1/$2"
shift
http ${VERB} --verify=no "$url" -b
}
function next-ami(){
cluster=$1
prepare-ami $cluster true | \
jq ".environment.images | reverse | .[0]"
}
function prepare-ami(){
cluster=$1
includeEnv=$2
asgard GET "deployment/prepare/${cluster}?deploymentTemplateName=CreateAndCleanUpPreviousAsg&includeEnvironment=${includeEnv}"
}
function get-next-ami(){
cluster=$1
next=`next-ami ${cluster} | jq ".id"`
prepare-ami ${cluster} "false" | jq ".lcOptions.imageId |= ${next}"
}
function start-deployment(){
cluster=$1
payload=$2
echo $payload | asgard POST "deployment/start/${cluster}"
}
Source post: http://onoffswitch.net/scripting-deployment-clusters-asgard/