Skip to content

Instantly share code, notes, and snippets.

@ashutoshkarna03
Created May 18, 2020 18:31
Show Gist options
  • Save ashutoshkarna03/166969d545939194a39448f864014f8c to your computer and use it in GitHub Desktop.
Save ashutoshkarna03/166969d545939194a39448f864014f8c to your computer and use it in GitHub Desktop.
def get_instance_details(instance_id, client):
response = client.describe_instances(
InstanceIds=[
instance_id,
],
)
return dict(
instance_type = response['Reservations'][0]['Instances'][0]['InstanceType'],
state = response['Reservations'][0]['Instances'][0]['State']['Name'],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment