-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using NullProvider for credentials with Localstack causes unexpected behavior #1111
Comments
Further making this weird is that not only do I have Somewhere along the line, Async AWS is losing track of the region. |
Digging deeper, it appears that using - $credentials = new NullProvider();
+ $credentials = new ConfigurationProvider(); Then everything seems to work as expected. |
Could you please provide a reproducer? how do you create the client? |
In this case, it is My configuration before, which was not working: $config = [
'region' => 'us-west-2',
'endpoint' => 'http://localhost:4566',
];
$credentials = new NullProvider();
$client = new SqsClient($config, $credentials); After figuring out the root cause and updating: $config = [
'region' => 'us-west-2',
'endpoint' => 'http://localhost:4566',
'accessKeyId' => 'test',
'accessKeySecret' => 'test',
];
$credentials = ChainProvider::createDefaultChain();
$client = new SqsClient($config, $credentials); |
Actually, AWS uses region for 2 things:
I don't know how localstack works internally, but I believe it extracts the region from the signature. That's why the request must be signed and you have to provide credentials. I'm not sure what is the best solution for AsyncAws
WDYT @Nyholm ? |
I think the solution here is simply documenting that |
Interesting. Yeah. I agree with both of you. Let's add a section in the docs about "Localstack" or local development. |
I am using localstack for development and noticed a discrepancy between the official AWS SDK and Async AWS.
My configuration is:
If I use (eg)
AsyncAws\Sqs\SqsClient
to create a new queue called "test":When I check it via CLI:
There is no output, as if the queue wasn't created. But when I do:
It exists, but not in the region that I specified.
The text was updated successfully, but these errors were encountered: