Last active
February 25, 2021 16:35
-
-
Save allenmichael/2fcd80e355ff26d2c87e20cb95af8a16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating and adding key to Cloud9 environment | |
ssh-keygen -f ~/path/to/store/key | |
cat key.pub | pbcopy | |
# Restarting an environment | |
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag-key,Values=Environment" "Name=tag-value,Values=Testing" --query Reservations[0].Instances[0].[InstanceId] --output text) | |
aws ec2 describe-instance-status --instance-ids $INSTANCE_ID | |
aws ec2 start-instances --instance-ids $INSTANCE_ID | |
aws ec2 describe-instances --filters "Name=tag-key,Values=Environment" "Name=tag-value,Values=Testing" --query Reservations[].Instances[].[PublicDnsName,InstanceId,Status] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment