Skip to content

Commit 609dbe6

Browse files
committed
Fix 040+042 Q Business: use configured region, fix jq status path — both pass in analytics account
040: hardcoded us-east-1 → use AWS_DEFAULT_REGION 042: same + jq path .application.status → .status (top-level) Score: 63/66 pass (95%). Remaining: 018 (ECS registration), 035 (AD directory), 059 (DataZone IC integration)
1 parent 65f362f commit 609dbe6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tuts/040-qbusiness-ica/qbusiness-ica.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Version 3-working: Uses existing users since AWS CLI version doesn't support user creation
66

77
# Set AWS region explicitly to avoid cross-region issues
8-
AWS_REGION="us-east-1" # Change this to your preferred region
8+
AWS_REGION="${AWS_DEFAULT_REGION:-us-east-1}" # Uses configured region or defaults to us-east-1
99
export AWS_DEFAULT_REGION="$AWS_REGION"
1010

1111
# Initialize log file

tuts/042-qbusiness-anon/qbusiness-anon.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LOG_FILE="qbusiness-anonymous-app-creation.log"
1111
echo "Starting script execution at $(date)" > "$LOG_FILE"
1212

1313
# Set region to a supported region for Amazon Q Business
14-
AWS_REGION="us-east-1"
14+
AWS_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
1515
echo "Using AWS region: $AWS_REGION" | tee -a "$LOG_FILE"
1616

1717
# Function to log commands and their outputs
@@ -181,7 +181,7 @@ check_error "$VERIFY_OUTPUT" $? "Failed to verify application creation"
181181

182182
# Check if application status is ACTIVE using jq for safer JSON parsing
183183
if command -v jq &> /dev/null; then
184-
APP_STATUS=$(echo "$VERIFY_OUTPUT" | jq -r '.application.status')
184+
APP_STATUS=$(echo "$VERIFY_OUTPUT" | jq -r '.status')
185185
else
186186
APP_STATUS=$(echo "$VERIFY_OUTPUT" | grep -o '"status": "[^"]*' | cut -d'"' -f4)
187187
fi

0 commit comments

Comments
 (0)