Skip to content

Instantly share code, notes, and snippets.

@imeredith
Created June 16, 2012 04:51
Show Gist options
  • Save imeredith/2939966 to your computer and use it in GitHub Desktop.
Save imeredith/2939966 to your computer and use it in GitHub Desktop.
def instanceState(id: String)(implicit c: AWSEC2Client, region: String = null) = {
for {
instance <- c.getInstanceServices.describeInstancesInRegion(region, id).headOption
runningInstance <- instance.headOption
} yield runningInstance.getInstanceState
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment