-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add alias to reboot cheque parser instance
Signed-off-by: Sébastien Elet <sebastien@elet.fr>
- Loading branch information
1 parent
f279bca
commit ae63f40
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
INSTANCE_NAME="Cheque Parser" | ||
export AWS_PROFILE="prod" | ||
|
||
# Retrieve instance Id | ||
INSTANCE_ID=$(aws ec2 describe-instances \ | ||
--filters "Name=tag:Name,Values=$INSTANCE_NAME" \ | ||
--query "Reservations[].Instances[].InstanceId" \ | ||
--output text) | ||
|
||
if [ -z "$INSTANCE_ID" ]; then | ||
echo "No instance with name $INSTANCE_NAME." | ||
exit 1 | ||
fi | ||
|
||
aws ec2 reboot-instances --instance-ids $INSTANCE_ID | ||
|
||
echo "Instance $INSTANCE_NAME ($INSTANCE_ID) is rebooting..." |