Fix setup.sh overwriting ~/.aws/credentials and ~/.aws/config - #18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
00-setup/setup.shusedcat > ~/.aws/credentialsandcat > ~/.aws/configto 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.awslocal(already listed as a required tool in00-setup/README.md) instead of rawaws.awslocalsets dummy credentials and the local endpoint via environment variables scoped to that single invocation, so it never touches~/.aws/*. This also bringssetup.shin line with every other module in the workshop, which already usesawslocal/tflocal/etc.Big thank you to @kakakakakku for reporting this issue on Twitter 🙏 , and apologies for the inconvenience this may have caused!
Test plan
./00-setup/setup.shwith an existing~/.aws/credentials/~/.aws/configcontaining real profiles and confirm they are left untouched.awslocal s3 ls/ health check verification steps.🤖 Generated with Claude Code