brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
314 stars 63 forks source link

Option to not update configs with AWS tokens #123

Open mchristie opened 1 year ago

mchristie commented 1 year ago

Although it's recommended to use AWS roles that's not always possible.

If the application is setting AWS keys and secrets with credentials which do not need an AWS token, adding the token in from the function role will cause the credentials to become invalid.

This PR adds a config option which disables updating the AWS configs with AWS_SESSION_TOKEN

deleugpn commented 1 year ago

My take on this is that the behavior of the adapter is to casually adjust Laravel's default installation for a quick drop-in replacement for Lambda. If you're deploying your project into Lambda it's an opportunity to replace secret keys with IAM Roles. However, if you have reasons to stick with access key / secret key, all you'd have to do is change the name of the driver / connection you're using. E.g. if instead of using the s3 disk on your filesystems config, you could just name it something else like bucket or storage or the business meaning behind the files that get stored there. Anything that is not the default laravel installation configuration wouldn't be touched by the Bridge and you'd be free to configure it however you feel like it. It seems like a low effort on the user's part and one less configuration that Bref would have to maintain.

mnapoli commented 1 year ago

Yeah, I'd tend to agree with @deleugpn as this is a niche use case. I'm not against merging this, but I'm not especially pushing for it. I'll let you guys decide.