Skip to content

Commit 4d01ba6

Browse files
committed
Error if credentials set in terminal
1 parent e1733e2 commit 4d01ba6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lab/bin/reset-environment

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
if [ ! -z "${AWS_ACCESS_KEY_ID}" ]; then
4+
echo "Error: You have AWS credentials set in this terminal"
5+
echo "This IDE is configured to use an IAM instance profile with the appropriate permissions"
6+
echo ""
7+
echo "Please close this terminal and open a new one, do not set AWS_ACCESS_KEY_ID or any related variables"
8+
exit 1
9+
fi
10+
311
# Make sure we run from a consistent directory
412
cd ~
513

0 commit comments

Comments
 (0)