baopham / laravel-dynamodb

Eloquent syntax for DynamoDB
https://packagist.org/packages/baopham/dynamodb
MIT License
490 stars 127 forks source link

Question about dynamodb.php config file #239

Closed Dumk0 closed 2 years ago

Dumk0 commented 3 years ago

There is aws_iam_role block In the project config sample. What for it is?

Another thing I have faced, is that 'debug' takes much more memory and may cause Memory Limit Error on local dynamodb instance. Maybe this option should also be depending on DYNAMODB_DEBUG env var?

hanachan1026 commented 3 years ago

Similar guestion about dynamodb.php

There is token field but how can I acquire token from EC2 instance role?

I would like to access DynamoDB from Laravel on EC2 but I do not want to use ACCESS_KEY & SECRET.

JackPriceBurns commented 3 years ago

If you've got an instance role associated with the EC2 instance, you can remove the access key, secret and token from the dynamodb.php file the AWS SDK is smart enough to grab this information for you.

You could, if you really wanted to, grab this information manually through the instance metadata api, however I would not recommend doing this. You can read more here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html