PHPackages                             rtek/aws-gen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rtek/aws-gen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rtek/aws-gen
============

Generate PHP wrapper classes for AWS services, operations and types

0.1.0(7y ago)04MITPHPPHP ^7.1

Since Mar 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rtek/aws-gen)[ Packagist](https://packagist.org/packages/rtek/aws-gen)[ Docs](https://github.com/rtek/aws-gen)[ RSS](/packages/rtek-aws-gen/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

AwsGen - PHP classes for the [AWS SDK](https://github.com/aws/aws-sdk-php)
==========================================================================

[](#awsgen---php-classes-for-the-aws-sdk)

AwsGen generates strictly typed PHP classes that allow you to use Amazon Web Services with objects instead of arrays.

Installation
------------

[](#installation)

`\Rtek\AwsGen` has no runtime component, so require it as a development dependency:

```
$ composer require --dev rtek/aws-gen

```

Why Bother?
-----------

[](#why-bother)

AWS has approximately 170 services with ~18,000 types. The SDK provides access to these services using `\ArrayAccess` and rich runtime [metadata](https://github.com/aws/aws-sdk-php/tree/master/src/data), but does not offer code-completion by realizing the API in PHP classes\*.

`\Rtek\AwsGen` will generate PHP classes for the services and operations that you choose, while allowing you to use the underlying SDK at all times.

You can treat these classes as read-only, or embed them in your project as the basis for more sophisticated wrappers.

\*If you used AwsGen for all services, there would be ~10x the number of files as the SDK

An Example: S3 Service
----------------------

[](#an-example-s3-service)

### Console generation

[](#console-generation)

```
$ vendor/bin/aws-gen generate

 Search Service:
 > s3

 Choose Service [Search again]:
  [0] Stop searching
  [1] Search again
  [2] s3
  [3] s3:2006-03-01
  [4] s3control
  [5] s3control:2018-08-20
 > 2

 What namespace? [App\AwsGen\]:
 > App\AwsGen\

 What output directory? [src]:
 > src

 PSR-4 namespace prefix? [App\AwsGen\]:
  [0]
  [1] App\
  [2] App\AwsGen\
 > 1

Generating: s3
==============

 Added s3:latest
 Generating...
 ...Complete

 [OK] Wrote 294 files to src/AwsGen/

```

### PHP generation

[](#php-generation)

```
