kitar / laravel-dynamodb

A DynamoDB based Eloquent model and Query builder for Laravel.
MIT License
179 stars 27 forks source link

Config parameter names in README incorrect #22

Closed martsie closed 1 year ago

martsie commented 2 years ago

In the Readme of this repo it states to use key and secret when creating a connection

'connections' => [

    'dynamodb' => [
        'driver' => 'dynamodb',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
        'token' => env('AWS_SESSION_TOKEN', null),
        'endpoint' => env('DYNAMODB_ENDPOINT', null),
        'prefix' => '', // table prefix
    ],

    ...

],

however in Connection.php the sdk is initiated as:

$sdk = new AwsSdk([
            'region' => $config['region'] ?? 'us-east-1',
            'version' => $config['version'] ?? 'latest',
            'credentials' => [
                'key' => $config['access_key'] ?? '',
                'secret' => $config['secret_key'] ?? ''
            ]
        ]);

where the key is expected to come from a config parameter called access_key and the secret from a config parameter named secret_key.

kitar commented 2 years ago

Hi @martsie, thank you for testing it out!

May be you are looking for different versions of README.md and Connection.php. In this release, we've renamed access_key / secret_key to key / secret.

It's backward compatible at this time so you can still use both names, but key / secret is recommended :)

martsie commented 2 years ago

Hi @kitar I followed the instructions exactly as they are on the github page for this project https://github.com/kitar/laravel-dynamodb - so that includes running composer require kitar/laravel-dynamodb and then all the setup after that. The parameters were not backwards compatible which led me to debugging the Connection.php file until I found the issue.

If you'd like to wait until the Github Readme and composer release fall into sync, we can close this issue but leave it searchable so that if other people have the same issue they can find it and resolve it.

kitar commented 2 years ago

Hi @martsie, could you check your installed version of kitar/laravel-dynamodb?

README.md here is the latest version, but the code in the comment above looks a bit older. The latest version of Connection.php can be found here.

kitar commented 1 year ago

I'll close this issue at this time. Please let me know if this is not resolved.