Created
January 8, 2016 17:36
-
-
Save johnallen3d/2cc33b44f49f49c570ee to your computer and use it in GitHub Desktop.
Create an elastigroup cluster on spotinst.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PASSWORD=$1 | |
if [[ $1 = '' ]]; then | |
echo Please provide your spotinst password | |
exit 1 | |
fi | |
echo $PASSWORD | |
echo "username=john.allen@technekes.com&password=${PASSWORD}&grant_type=password&client_id=yZRQ4akeqQMZTG0g&client_secret=HzmdK7Aih17Xk4LkNDqflzByGOL00tOV" | |
TOKEN=$( | |
curl \ | |
-X POST \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=john.allen@technekes.com&password=${PASSWORD}&grant_type=password&client_id=yZRQ4akeqQMZTG0g&client_secret=HzmdK7Aih17Xk4LkNDqflzByGOL00tOV" \ | |
https://www.spotinst.com:9540/token \ | |
| jq '.response.items[0].accessToken' | |
) | |
echo $TOKEN | |
curl \ | |
-X POST \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer ${TOKEN}" \ | |
-d @clusters/tk-qa-pap-ecs.json \ | |
'https://www.spotinst.com:8081/aws/ec2/group' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment