Web::AssetLib::OutputEngine::S3 - allows exporting an asset or bundle to an AWS S3 Bucket
On first usage, a cache will be generated of all files in the bucket. This way, we know what needs to be uploaded and what's already there.
my $library = My::AssetLib::Library->new( output_engines => [ Web::AssetLib::OutputEngine::S3->new( access_key => 'AWS_ACCESS_KEY', secret_key => 'AWS_SECRET_KEY', bucket_name => 'S3_BUCKET_NAME', region => 'S3_BUCKET_REGION' ) ] ); $library->compile( ..., output_engine => 'S3' );
This is an output engine plugin for Web::AssetLib.
Instantiate with access_key, secret_key, bucket_name, and region arguments, and include in your library's output engine list.
access_key
secret_key
bucket_name
region
AWS access & secret keys. Must have List and Put permissions for destination bucket. Required.
List
Put
S3 bucket name. Required.
AWS region name of the bucket. Required.
AWS region name of the bucket
Used as the base url of any asset that gets exported to S3. Make sure it's public! Your CDN may go here.
Provide a coderef used to calculate the Expiration header. Currently, no arguments are passed to the callback. Defaults to:
sub { return DateTime->now( time_zone => 'local' )->add( years => 1 ); };
Web::AssetLib Web::AssetLib::OutputEngine
Ryan Lang <rlang@cpan.org>
To install Web::AssetLib::OutputEngine::S3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::AssetLib::OutputEngine::S3
CPAN shell
perl -MCPAN -e shell install Web::AssetLib::OutputEngine::S3
For more information on module installation, please visit the detailed CPAN module installation guide.