Skip to content

Commit 859585d

Browse files
committed
Fix 6 test failures: 3 still-interactive, 1 syntax, 1 local-outside-fn, 1 wait-loop
033-ses: replaced Press Enter waits with sleep 085-ecs-sc: auto-answer cleanup prompt 046-ssm: auto-answer region + cleanup prompts 055-vpc-lattice: fixed regex bracket + contraction in comment 081-mediaconnect: local → regular variable at top level 001-lightsail: snapshot state 'completed' → 'available'
1 parent 027878c commit 859585d

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

tuts/001-lightsail-gs/lightsail-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ MAX_ATTEMPTS=60
233233
ATTEMPTS=0
234234
while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do
235235
SNAPSHOT_STATE=$(aws lightsail get-instance-snapshot --instance-snapshot-name "$SNAPSHOT_NAME" --region "$AWS_REGION" --query 'instanceSnapshot.state' --output text 2>/dev/null || echo "unknown")
236-
if [ "$SNAPSHOT_STATE" == "completed" ]; then
236+
if [ "$SNAPSHOT_STATE" == "available" ]; then
237237
echo "Snapshot creation completed"
238238
break
239239
fi

tuts/033-ses-gs/ses-gs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ CREATED_RESOURCES+=("Email identity: $EMAIL_ADDRESS")
8080
echo "A verification email has been sent to $EMAIL_ADDRESS."
8181
echo "Please check your inbox and click the verification link before continuing."
8282
echo ""
83-
echo "Press Enter after you've verified your email address..."
83+
echo "Waiting for email verification (auto-skipping in non-interactive mode)..."
84+
sleep 2
8485
sleep 1
8586

8687
# Check verification status
@@ -217,7 +218,8 @@ if [[ "$SEND_TEST" =~ ^[Yy] ]]; then
217218
echo "A verification email has been sent to $RECIPIENT_EMAIL."
218219
echo "Please check the inbox and click the verification link before continuing."
219220
echo ""
220-
echo "Press Enter after you've verified the recipient email address..."
221+
echo "Waiting for recipient verification (auto-skipping)..."
222+
sleep 2
221223
sleep 1
222224

223225
# Check recipient verification status

tuts/046-aws-systems-manager-gs/aws-systems-manager-gs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ echo ""
114114
CURRENT_REGION=$(aws configure get region)
115115
if [[ -z "$CURRENT_REGION" ]]; then
116116
echo "No AWS region configured. Please specify a region:"
117-
read -r CURRENT_REGION
117+
CURRENT_REGION="${AWS_DEFAULT_REGION:-us-west-2}"
118118
if [[ -z "$CURRENT_REGION" ]]; then
119119
echo "ERROR: A region must be specified" | tee -a "$LOG_FILE"
120120
exit 1
@@ -537,7 +537,7 @@ echo "==========================================="
537537
echo "CLEANUP CONFIRMATION"
538538
echo "==========================================="
539539
echo "Do you want to clean up all created resources? (y/n): "
540-
read -r CLEANUP_CHOICE
540+
CLEANUP_CHOICE="y"
541541

542542
if [[ "$CLEANUP_CHOICE" =~ ^[Yy]$ ]]; then
543543
echo "Cleaning up resources..." | tee -a "$LOG_FILE"

tuts/055-amazon-vpc-lattice-gs/amazon-vpc-lattice-getting-started.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ validate_input() {
4747
fi
4848

4949
# Validate against common injection patterns
50-
if [[ "$input" =~ [';$`|&<>(){}] ]]; then
50+
if [[ "$input" =~ [\;\$\`\|\&\<\>\(\)\{\}] ]]; then
5151
echo "ERROR: $param_name contains invalid characters" | tee -a "$LOG_FILE"
5252
return 1
5353
fi
@@ -78,7 +78,7 @@ wait_for_resource() {
7878
status_output=$(eval "$command" 2>&1) || true
7979
echo "$status_output" >> "$LOG_FILE"
8080

81-
# For service networks, they don't have a status field in the output
81+
# For service networks, they do not have a status field in the output
8282
# We'll consider them active if we can retrieve them
8383
if [[ "$resource_type" == "Service Network" ]]; then
8484
if [[ "$status_output" == *"$resource_id"* ]]; then

tuts/081-aws-elemental-mediaconnect-gs/aws-elemental-mediaconnect-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ trap cleanup_resources EXIT
121121
validate_aws_cli
122122

123123
# Get the current AWS region
124-
local aws_region
124+
aws_region=""
125125
if aws_region=$(aws configure get region 2>/dev/null); then
126126
if [ -z "$aws_region" ]; then
127127
handle_error "Failed to get AWS region. Please make sure AWS CLI is configured."

tuts/085-amazon-ecs-service-connect/amazon-ecs-service-connect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ main() {
570570
echo "CLEANUP CONFIRMATION"
571571
echo "==========================================="
572572
echo "Do you want to clean up all created resources? (y/n): "
573-
read -r CLEANUP_CHOICE
573+
CLEANUP_CHOICE="y"
574574

575575
if [[ "$CLEANUP_CHOICE" =~ ^[Yy]$ ]]; then
576576
cleanup_resources

0 commit comments

Comments
 (0)