Skip to content

Fix setup.sh overwriting ~/.aws/credentials and ~/.aws/config - #18

Merged
whummer merged 2 commits into
mainfrom
fix/setup-script-clobbers-aws-config
Aug 18, 2026
Merged

Fix setup.sh overwriting ~/.aws/credentials and ~/.aws/config#18
whummer merged 2 commits into
mainfrom
fix/setup-script-clobbers-aws-config

Conversation

@whummer

@whummer whummer commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

  • 00-setup/setup.sh used cat > ~/.aws/credentials and cat > ~/.aws/config to inject dummy LocalStack credentials into the default profile, truncating both files and destroying any existing real AWS profiles a user had configured. This was reported by a workshop attendee.
  • The verification step now uses awslocal (already listed as a required tool in 00-setup/README.md) instead of raw aws. awslocal sets dummy credentials and the local endpoint via environment variables scoped to that single invocation, so it never touches ~/.aws/*. This also brings setup.sh in line with every other module in the workshop, which already uses awslocal/tflocal/etc.

Big thank you to @kakakakakku for reporting this issue on Twitter 🙏 , and apologies for the inconvenience this may have caused!

Test plan

  • Run ./00-setup/setup.sh with an existing ~/.aws/credentials/~/.aws/config containing real profiles and confirm they are left untouched.
  • Confirm the script still starts LocalStack, waits for readiness, and passes the awslocal s3 ls / health check verification steps.

🤖 Generated with Claude Code

whummer and others added 2 commits August 18, 2026 15:59
The script truncated both files to write dummy LocalStack credentials
into the default profile, wiping out any existing real AWS profiles.
Switch the verification step to awslocal, which already sets dummy
credentials via env vars per-invocation and never touches ~/.aws,
consistent with how every other module in the workshop connects to
LocalStack.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The ver1 extra pulls in the classic Python-importable awscli v1
package, which awslocal then calls in-process. That in-process path
still imports botocore.vendored, a module removed from modern
botocore, so it crashed with ModuleNotFoundError. Without the extra,
awslocal shells out to the standalone aws CLI v2 binary already
preinstalled on the runner instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@whummer
whummer merged commit 9403b0f into main Aug 18, 2026
1 check passed
@whummer
whummer deleted the fix/setup-script-clobbers-aws-config branch August 18, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant