Created
August 24, 2012 23:13
-
-
Save mjul/3456996 to your computer and use it in GitHub Desktop.
Start and stop an Amazon EC2 server in EU region from Pallet
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
(defn start [config] | |
(pallet.core/converge | |
(pallet.core/group-spec "mygroup" | |
:count 1 | |
:node-spec (pallet.core/node-spec | |
:image {:os-family :ubuntu} | |
:location {:location-id "eu-west-1"})) ;; :location-id is the name of the AWS Region | |
:compute config)) | |
(defn stop [config] | |
(pallet.core/converge | |
(pallet.core/group-spec "mygroup" :count 0) | |
:compute config)) | |
;; Let's try it out.... | |
;; You can get your Access Key credentials in the AWS web site under "My Account". | |
(def cfg (pallet.configure/compute-service "aws-ec2" | |
:identity "____INSERT_YOUR_KEY____" | |
:credential "____INSERT_YOUR_SECRET_KEY___")) | |
(start cfg) | |
(stop cfg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment