customergauge/redshift
Composer 安装命令:
composer require customergauge/redshift
包简介
Redshift Connector for Laravel with AWS Secret Manager
README 文档
README
This library provides a custom database driver for Laravel to connect seamlessly with Amazon Redshift. It allows proper integration with Redshift’s PostgreSQL-compatible interface, with support for custom connection behaviors and optional AWS Secrets Manager integration.
Inspiration
This library was inspired on Laravel Aurora Connector
🚀 Installation
composer require customergauge/redshift
⚙️ Usage
In your config/database.php, define a connection using the redshift driver:
'redshift' => [ 'driver' => 'redshift', 'host' => env('REDSHIFT_HOST'), 'port' => env('REDSHIFT_PORT', 5439), 'database' => env('REDSHIFT_DATABASE'), 'username' => env('REDSHIFT_USERNAME'), 'password' => env('REDSHIFT_PASSWORD'), 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', 'options' => [], 'redshift' => [ 'secret' => env('AWS_REDSHIFT_SECRET'), // optional 'temporary_credential' => [] // optional: IAM-based temporary auth ], ],
You can optionally configure a secret name for AWS AWS Secrets Manager via redshift.secret to securely fetch the database credentials.
Alternatively, if your application runs with sufficient IAM permissions, you can use temporary credentials to connect to Redshift. To enable this, set the temporary_credential option in the redshift config:
'temporary_credential' => [ 'workgroupName' => 'your-redshift-workgroup-name', // mandatory to work // You may also pass any valid parameters supported by AWS Redshift Serverless getCredentials API ],
When this option is enabled, the application will connect to Amazon Redshift using short-lived credentials obtained via AWS IAM authentication, improving security by avoiding static passwords and enabling fine-grained access control.
This requires your application (e.g. ECS task, Lambda, EC2, etc.) to assume an IAM role with permission to call redshift-serverless:GetCredentials
🌍 AWS Configuration
Make sure you define your AWS region in config/aws.php, especially if using Secrets Manager:
return [ 'region' => env('AWS_REGION', 'eu-west-1'), // other AWS services config ];
📦 Secrets Manager Support
This package can integrate with AWS Secrets Manager to load your Redshift credentials at runtime.
To improve performance, we recommend using the AWS Secrets Manager Caching Extension.
🧪 Example Query
Once configured, you can use Eloquent or Query Builder as usual:
DB::connection('redshift')->table('events')->select('user_id')->limit(10)->get();
🤝 Contributing
We welcome contributions! Feel free to open issues, suggest improvements, or submit PRs.
📝 License
Laravel Redshift Connector is licensed under the MIT License.
customergauge/redshift 适用场景与选型建议
customergauge/redshift 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.05k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 06 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「password」 「postgres」 「laravel」 「connector」 「secret」 「redshift」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 customergauge/redshift 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 customergauge/redshift 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 customergauge/redshift 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The PHP class PasswordGenerator serves as a password generator to create memorable passwords like the keychain of macOS ≤ 10.14 did.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
A library for reading KeePass 2.x databases
Bundle for Doctrine enumerations extension for Postgres
Doctrine extension to manage enumerations in PostgreSQL
统计信息
- 总下载量: 2.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-02