healthengine/laravel-easy-aws
Composer 安装命令:
composer require healthengine/laravel-easy-aws
包简介
Cache dynamic AWS credentials
关键字:
README 文档
README
This is an extension to the Laravel AWS SDK that provides cacheable
dynamic credentials - such as those provided by the EC2 Metadata API. This is necessary if you want to
php artisan config:cache whilst also not using hard coded credentials - since Laravel is unable to cache the Guzzle
promise that resolves to credentials when used.
It also binds certain AWS client objects to the Laravel container so you can typehint the specific clients you need,
instead of using the AWS facade. Clients are added as needed and we welcome PRs so if you need one that is missing,
please contribute.
Installation
composer require healthengine/laravel-easy-aws
Usage
There's not much to it. You can now typehint the S3Client directly and it will be resolved instead of having to use
the facade to construct the S3 client:
// before $s3 = AWS::createClient('s3'); // after $s3 = app(Aws\S3\S3Client::class);
Credentials are resolved automatically using the default provider chain from the AWS SDK. The only difference is that they will be cached. This really only helps if that credentials chain ended up resolving credentials from the EC2 Metadata API, otherwise it would have been using hardcoded credentials of some kind and caching them doesn't help much.
You can configure which cache store to use by setting the environment variable EASYAWS_CACHE_STORE to any built in
Laravel cache drivers.
Note
Caching credentials can be insecure. Be careful if you are going to use an external cache driver like Redis or database as the credentials are stored in plaintext.
SQS Client
The queue configuration for AWS SQS has also been modified to use these cached credentials. This means you don't need to
add a key or secret for that client - if using SQS as your queue driver. Also please note that the prefix
configuration key is not used because it is redundant, you'll need to prepend the value of prefix to queue.
License
Laravel Easy AWS is licensed under the MIT license.
healthengine/laravel-easy-aws 适用场景与选型建议
healthengine/laravel-easy-aws 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 260.93k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cache」 「aws」 「laravel」 「credentials」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 healthengine/laravel-easy-aws 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 healthengine/laravel-easy-aws 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 healthengine/laravel-easy-aws 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.
Elastic Driver for Laravel Scout
simple api library.
Laravel 5 - Repositories to the database layer
A replica of the AWS Elastic Beanstalk worker SQS daemon (sqsd) in PHP
统计信息
- 总下载量: 260.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-09