Skip to content

Commit

Permalink
Fix setting DynamoDB credentials (#36822)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Mar 30, 2021
1 parent 35e339b commit 8e1f620
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Illuminate/Cache/CacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ public function register()
$this->app->singleton('cache.dynamodb.client', function ($app) {
$config = $app['config']->get('cache.stores.dynamodb');

return new DynamoDbClient([
$dynamoConfig = [
'region' => $config['region'],
'version' => 'latest',
'endpoint' => $config['endpoint'] ?? null,
'credentials' => Arr::only(
];

if ($config['key'] && $config['secret']) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secret', 'token']
),
]);
);
}

return new DynamoDbClient($dynamoConfig);
});
}

Expand Down

0 comments on commit 8e1f620

Please sign in to comment.