Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
INSTANCE_ID=$(aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | {id: .InstanceId, name: .Tags[] | select(.Key == "Name") | .Value} | select(.name == "carl-development") | .id')
aws ec2 start-instances --instance-ids "$INSTANCE_ID"
#!/bin/bash
INSTANCE_ID=$(aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | {id: .InstanceId, name: .Tags[] | select(.Key == "Name") | .Value} | select(.name == "carl-development") | .id')
aws ec2 stop-instances --instance-ids "$INSTANCE_ID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.