GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - modulusphp/aws-sdk: AWS SDK for Modulus (Work in progress)

This repository was archived by the owner on Jan 5, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
img/cloudwatch
img/cloudwatch
 
 
src
src
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

AWS SDK for Modulus

The AWS SDK for Modulus makes it easy for developers to use Amazon Web Services in Modulus.

Install

Require the package with composer:

composer require modulus/aws-sdk

Create a aws.php config file:

<?php

return [
  'credentials' => [
    'key'    => env('AWS_ACCESS_KEY_ID', ''),
    'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
  ],
  'region' => env('AWS_REGION', 'eu-west-1'),
  'version' => 'latest'
];

And finally set the correct environment variables in the .env file.


Logging

The CloudWatch Monolog Driver allows you to store your Modulus logs in AWS. You can then easily view them, search them for specific error codes or patterns, filter them based on specific fields, or archive them securely for future analysis.

Getting Started

To start using CloudWatch, you need to add a new logging channel in the logging.php config file:

'channels' => [
  ...

  'cloudwatch' => [
    'driver' => 'cloudwatch',
    'group_name' => env('CLOUDWATCH_GROUP_NAME', '/aws/modulus/application'),
    'steam_name' => env('CLOUDWATCH_STREAM_NAME', 'ec2-instance'),
    'days' => 14
  ]
];

After adding a new channel, you will need to register the cloudwatch driver in the AppServiceResolver boot function:

use Modulus\Framework\Upstart\Service;
use Modulus\Hibernate\Logging\MonologBase;

class AppServiceResolver extends Service
{
  /**
   * Register application services
   *
   * @param mixed $app
   * @return void
   */
  protected function boot($app) : void {
    MonologBase::register(
      'cloudwatch',
      \Modulus\Aws\Services\CloudWatch\MonologDriver::class
    );
  }
}

Once you have registered the cloudwatch driver and added a new channel for cloudwatch, you can start logging to AWS CloudWatch:

\Log::channel('cloudwatch')->info('Successfully created a new user', ['name' => 'Donald', 'age' => 22]);

If you want to use cloudwatch as the default channel, you can change the logging.default value to cloudwatch in the logging.php config file:

<?php

return [
  'default' => 'cloudwatch',
  ...

Now when logging data, you won't need to specify the channel:

\Log::alert('Could not create user', ['name' => 'Donald']);

Results:

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

About

AWS SDK for Modulus (Work in progress)

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.