From 4d01ba669d20fd6c110ff98c9e0a2cfc7dbd9daa Mon Sep 17 00:00:00 2001 From: Niall Thomson Date: Mon, 2 Dec 2024 16:41:02 -0800 Subject: [PATCH] Error if credentials set in terminal --- lab/bin/reset-environment | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lab/bin/reset-environment b/lab/bin/reset-environment index 34762661e..d5c4a900f 100644 --- a/lab/bin/reset-environment +++ b/lab/bin/reset-environment @@ -1,5 +1,13 @@ #!/bin/bash +if [ ! -z "${AWS_ACCESS_KEY_ID}" ]; then + echo "Error: You have AWS credentials set in this terminal" + echo "This IDE is configured to use an IAM instance profile with the appropriate permissions" + echo "" + echo "Please close this terminal and open a new one, do not set AWS_ACCESS_KEY_ID or any related variables" + exit 1 +fi + # Make sure we run from a consistent directory cd ~