Jul 30, 2021
0
Level 1
Vapor config null
Hi guys, i try to use this package https://github.com/baopham/laravel-dynamodb within vapor. However i cant make this package work since the it set the AWS config in config file.
This is the config file from dynamodb.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Default DynamoDb Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the DynamoDb connections below you wish
| to use as your default connection for all DynamoDb work.
*/
'default' => env('DYNAMODB_CONNECTION', 'aws'),
/*
|--------------------------------------------------------------------------
| DynamoDb Connections
|--------------------------------------------------------------------------
|
| Here are each of the DynamoDb connections setup for your application.
|
| Most of the connection's config will be fed directly to AwsClient
| constructor http://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.AwsClient.html#___construct
*/
'connections' => [
'aws' => [
'credentials' => [
'key' => env('AWS_ACCESS_KEY_ID', ''),
'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
// If using as an assumed IAM role, you can also use the `token` parameter
'token' => env('AWS_SESSION_TOKEN', ''),
],
'region' => env('AWS_REGION', 'eu-west-1'),
// if true, it will use Laravel Log.
// For advanced options, see http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html
'debug' => env('DYNAMODB_DEBUG', false),
],
'aws_iam_role' => [
'region' => env('AWS_REGION', ''),
'debug' => true,
],
'local' => [
'credentials' => [
'key' => 'dynamodb_local',
'secret' => 'secret',
],
'region' => 'stub',
// see http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html
'endpoint' => env('DYNAMODB_LOCAL_ENDPOINT'),
'debug' => true,
],
'test' => [
'credentials' => [
'key' => 'dynamodb_local',
'secret' => 'secret',
],
'region' => 'test',
'endpoint' => env('DYNAMODB_LOCAL_ENDPOINT'),
'debug' => true,
],
],
];
When i run vapor tinker development --code="dump(config('dynamodb.connections.aws'))"
The output is:
Output:
array:3 [
"credentials" => array:3 [
"key" => ""
"secret" => ""
"token" => ""
]
"region" => "eu-west-1"
"debug" => false
]
Seems it cannot get the aws key in config, it always return null. How do i make this to work?
Please or to participate in this conversation.