Fork me on GitHub
#aws
<
2019-01-18
>
Deano14:01:59

Hi everyone, I hope you are well. I am using the new Cognitect AWS-SDK, I would like to filter on running machines from a specific auto scaling group. The scaling group is stored as a tag on the EC2 machine This is what I have so far, could anyone nudge me in the right direction?

(def aws-ec2 (aws/client {:api :ec2}))
(aws/invoke aws-ec2 {:op :DescribeInstances :Filter [{:State "running"}]})
I have not included the tag in the example as I am trying to work out how to structure the code

gws15:01:09

does the code you wrote work as written? I'd guess that it wouldn't because "State" is not a valid filter key

aaelony16:01:52

something akin to (-> % :State :Name) could have the value of “running”