I use this in our pallet builder, which gets the dns name via public ip:
(defn get-aws-name [] (let [ip (-> (target-node) bean :publicAddresses first)] (str "ec2-" (apply str (replace {\. \-} ip)) ".compute-1.amazonaws.com")))
Private IPs also work through security groups:
(defn ips-in-group [group-name public-or-private] "Sequence of the first public IP from each node in the group" (->> (nodes-in-group group-name) (map bean) (map public-or-private) (map first)) (defn public-ips-in-group "Sequence of the first public IP from each node in the group" [group-name] (ips-in-group group-name :publicAddresses)) (defn private-ips-in-group "Sequence of the first public IP from each node in the group" [group-name] (ips-in-group group-name :privateAddresses))
source share