masitings/aws-secret-manager
Composer 安装命令:
composer require masitings/aws-secret-manager
包简介
README 文档
README
Integrate Laravel Application with Amazon Secret Manager.
Installation
You can install the package via composer :
composer require masitings/aws-secret-manager
Publish Config:
php artisan vendor:publish --provider="Masitings\AwsSecretManager\SecretManagerProvider"
Usage
This package will load and fetch the secrets from AWS Secret Manager in any configuration variable that exists in your project. Put your env value with this
AWS_DEFAULT_REGION=ap-southeast-1 AWS_SECRETS_TAG_NAME=stage AWS_SECRETS_TAG_VALUE=production
Change the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY with your own credential and assign that credential with AWSSecretManager permissions.
AWS_SECRETS_TAG_NAME and AWS_SECRETS_TAG_VALUE are used to pull down all the secrets that match the tag key/value.
In order to make it works, you need to match the Key with your dot array configuration. For example, we have database.php configuration like this :
<?php use Illuminate\Support\Str; return [ 'default' => env('DB_CONNECTION', 'mysql'), 'connections' => [ 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), ]) : [], ], ], ];
The key in your AWS Secret Manager will be something like this :
database.connections.mysql.driver
database.connections.mysql.url
database.connections.mysql.host
database.connections.mysql.port
database.connections.mysql.database
database.connections.mysql.username
database.connections.mysql.password
After that you can put the value according to the value in your .env file or another.
AWS Credentials
Since this package utilizes the PHP AWS SDK the following .env values are used or credentials set ~/.aws/credentials.
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html
masitings/aws-secret-manager 适用场景与选型建议
masitings/aws-secret-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 masitings/aws-secret-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 masitings/aws-secret-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-01-20