Skip to content

Commit af71a94

Browse files
committed
Fix 043-mq (SIGPIPE, password chars, EFS storage), 058-elb (local outside fn), 059-datazone (prereq)
043: SIGPIPE from urandom|fold|head under pipefail, special chars in password break shell, mq.t3.micro doesn't support EBS storage (use EFS). Still needs >10 min timeout. 058: local outside function at line 209 059: DataZone needs blueprints enabled (prereq, not script bug)
1 parent b8c0694 commit af71a94

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tuts/043-amazon-mq-gs/amazon-mq-gs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ trap 'handle_error "Script interrupted"' EXIT INT TERM
8181
validate_aws_credentials
8282

8383
# Generate a random identifier for resource names
84-
RANDOM_ID=$(LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | fold -w 8 | head -n 1)
84+
RANDOM_ID=$(LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | fold -w 8 | head -n 1 || true)
8585
BROKER_NAME="mq-broker-${RANDOM_ID}"
8686
SECRET_NAME="mq-broker-creds-${RANDOM_ID}"
8787
BROKER_ID=""
@@ -92,7 +92,7 @@ echo "Generating secure password and storing in AWS Secrets Manager..."
9292

9393
# Generate a secure password with special characters, numbers, uppercase and lowercase letters
9494
# Avoid characters that may cause issues: backslash, quotes
95-
MQ_PASSWORD=$(LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^&*()_+-=' < /dev/urandom | fold -w 20 | head -n 1)
95+
MQ_PASSWORD=$(LC_ALL=C tr -dc 'A-Za-z0-9_+-' < /dev/urandom | fold -w 20 | head -n 1 || true)
9696
MQ_USERNAME="mqadmin"
9797

9898
# Validate password was generated
@@ -141,7 +141,7 @@ BROKER_RESULT=$(aws mq create-broker \
141141
--users "Username=$MQ_USERNAME,Password=$MQ_PASSWORD,ConsoleAccess=true" \
142142
--publicly-accessible \
143143
--auto-minor-version-upgrade \
144-
--storage-type EBS \
144+
--storage-type EFS \
145145
2>&1)
146146

147147
# Check for errors

tuts/058-elastic-load-balancing-gs/elastic-load-balancing-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ if [ ${#INSTANCE_IDS[@]} -eq 0 ]; then
206206
else
207207
# Step 7: Register targets with the target group (up to 2 instances)
208208
echo "Registering targets with the target group..."
209-
local target_args=()
209+
target_args=()
210210
for i in "${!INSTANCE_IDS[@]}"; do
211211
if [ "$i" -lt 2 ]; then
212212
target_args+=("Id=${INSTANCE_IDS[$i]}")

0 commit comments

Comments
 (0)