Repository navigation
Add S3-specific endpoint to generated AWS profile - #473
Conversation
a55a980 to
295b8ed
Compare
3f4efd8 to
d9e5d98
Compare
joe4dev
left a comment
There was a problem hiding this comment.
Good to see S3 compatibility addressed in the AWS profile. That's particularly important to cdk. I really like the non-destructive edit in ~/.aws/profile 👏 ✨
A couple of non-blocking questions/suggestions:
❓ Do we want to offer a fallback for customers being blocked by DNS rebind protection, similar to the probing we do in the LocalStack Toolkit https://github.com/localstack/localstack-toolkit-vscode/pull/51?
This block follows the same idempotency and --force overwrite rules as the rest of the profile.
❓ What is the intended behavior of --force?
Given an existing ~/.aws/profile, both non-force and --force performed a non-destructive edit. Does --force simply skip the interactive "[Y/n]" prompt?
nit: The confirmation message "✔︎ Created LocalStack profile in ~/.aws/config" does not distinguish between Create and Update.
Sidenotes
Not directly related, just FYI:
d9e5d98 to
c14d0a2
Compare
|
Thanks for your feedback @joe4dev!
We already have this, and the PR keeps it working. lstk setup aws calls endpoint.ResolveHost, which looks up test.localhost.localstack.cloud. If that fails or doesn't return 127.0.0.1, it uses 127.0.0.1: and prints a note.
In the interactive flow,
This wording has been like this since the profile setup flow was added, and it applies to every profile write. I left it as is to keep this PR focused, I image the reason why it didn't distinguish originally was to not complicate logic. Happy to change in a follow up if you think it's important.
If you want the profile's endpoints, either pass your own |
I found that counter-intuitive if I want to test certain networking scenarios through my global AWS profile.
I often have to use the AWS CLI directly because |
The main blocker is the LocalStack Toolkit for VS Code in dev mode: I cannot open App Inspector during development because it depends on lstk detecting a running instance. This works with other tools such as the LS Console (i.e., Web App). Do we have an issue for this? |
I created this issue https://linear.app/localstack/issue/DEVX-1223 and will take a look one of these days. Thanks for raising this issue. |

Motivation
aws --profile localstackused directly (not through lstk's own proxies) sent S3 requests to the profile's general endpoint, breaking S3's virtual-host-style bucket addressing.Solution
lstk setup awsnow writes an S3 endpoint override in a [services localstack] block, referenced via services = localstack in the profile. It reuses the existing endpoint.S3Addressing helper already used by the Terraform/CDK proxies. This block follows the same idempotency and--forceoverwrite rules as the rest of the profile.Review
Small, self-contained, covered by unit and integration tests. Self-merge candidate.
Closes DEVX-755