Net::A...:Client(3pm)

πŸ’– Net::A...:Client β€” the manual page, but make it make sense πŸ’–

okay bestie, this is User Contributed Perl Documentation for Net::A...:Client(3pm) β€” yes the name is literally abbreviated with dots like that, it's giving mystery, it's giving ellipsis, we love her regardless ✨


🌸 NAME 🌸

Net::Amazon::S3::Client β€” an easy-to-use Amazon S3 client. that's it. that's the whole name section. lowercase slay. πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.992

she's at 0.992, not quite 1.0, we're on the journey together fr fr πŸ¦‹


✨ SYNOPSIS ✨

okay so here's the whole vibe, look:

# Build Client instance
my $client = Net::Amazon::S3::Client->new (
        # accepts all Net::Amazon::S3's arguments
        aws_access_key_id     => $aws_access_key_id,
        aws_secret_access_key => $aws_secret_access_key,
        retry                 => 1,
);

# or reuse an existing S3 connection
my $client = Net::Amazon::S3::Client->new (s3 => $s3);

# list all my buckets
# returns a list of L<Net::Amazon::S3::Client::Bucket> objects
my @buckets = $client->buckets;
foreach my $bucket (@buckets) {
        print $bucket->name . "\n";
}

# create a new bucket
# returns a L<Net::Amazon::S3::Client::Bucket> object
my $bucket = $client->create_bucket(
        name                => $bucket_name,
        acl_short           => 'private',
        location_constraint => 'us-east-1',
);

# or use an existing bucket
# returns a L<Net::Amazon::S3::Client::Bucket> object
my $bucket = $client->bucket( name => $bucket_name );

two ways to build her, one way to list your buckets, one way to make a bucket, one way to grab an existing bucket. iconic behaviour, no notes πŸ”₯


🫢 DESCRIPTION 🫢

okay so lore time. πŸ“–

The Net::Amazon::S3 module was written when the Amazon S3 service had just come out, and it is a light wrapper around the APIs. Some bad API decisions were also made. 😭 we don't talk about it. we've grown.

The Net::Amazon::S3::Client, Net::Amazon::S3::Client::Bucket and Net::Amazon::S3::Client::Object classes are designed after years of usage to be easy to use for common tasks. character development!! πŸ‘‘

These classes throw an exception when a fatal error occurs. It also is very careful to pass an MD5 of the content when uploaded to S3 and check the resultant ETag. she's thorough. she checks receipts. 🧾

⚠️ WARNING: This is an early release of the Client classes, the APIs may change. πŸ’€ so like. don't build your whole personality on these signatures. she said what she said.

πŸ‘‘ CONSTRUCTOR πŸ‘‘

the things you can hand over when you make her:

  • s3 β€” a Net::Amazon::S3 instance.
  • error_handler_class β€” the error handler class name (the package name, bestie πŸ’…), see Net::Amazon::S3::Error::Handler for more. It overrides one available in "s3".

Default: Net::Amazon::S3::Error::Handler::Confess β€” yes, it confesses. dramatic much? πŸ™ˆ

  • error_handler β€” an instance of the error handler class.

🌈 METHODS 🌈

πŸ’œ new

Net::Amazon::S3::Client can be constructed two ways.

Historically it wraps an S3 API instance, like:

use Net::Amazon::S3::Client;

my $client = Net::Amazon::S3::Client->new (
        s3 => .... # Net::Amazon::S3 instance
);

🌟 new (since v0.92)

Since v0.92 explicit creation of the S3 API instance is no longer necessary. Net::Amazon::S3::Client's constructor accepts same parameters as Net::Amazon::S3:

use Net::Amazon::S3::Client v0.92;

my $client = Net::Amazon::S3::Client->new (
        aws_access_key_id     => ...,
        aws_secret_access_key => ...,
        ...,
);

glow up unlocked ✨

πŸ¦‹ buckets

# list all my buckets
# returns a list of L<Net::Amazon::S3::Client::Bucket> objects
my @buckets = $client->buckets;
foreach my $bucket (@buckets) {
  print $bucket->name . "\n";
}

🌸 create_bucket

# create a new bucket
# returns a L<Net::Amazon::S3::Client::Bucket> object
my $bucket = $client->create_bucket(
  name                => $bucket_name,
  acl_short           => 'private',
  location_constraint => 'us-east-1',
);

πŸŽ€ bucket

# or use an existing bucket
# returns a L<Net::Amazon::S3::Client::Bucket> object
my $bucket = $client->bucket( name => $bucket_name );

⭐ bucket_class

# returns string "Net::Amazon::S3::Client::Bucket"
# subclasses will want to override this.
my $bucket_class = $client->bucket_class

subclasses, y'all know what to do. override it. that's your moment, your main character arc πŸ’…


🧚 AUTHOR 🧚

Branislav ZahradnΓ­k <barney@cpan.org>


This software is copyright (c) 2025 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav ZahradnΓ­k.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


okay that's the whole page bestie, you ate, I ate, S3 bucket created, periodt πŸ’…βœ¨

signing off from perl v5.40.1, dated 2025-12-07, still answering to the name Net::A...:Client(3pm) 🫢

πŸ“¦ where this page comes from