Amazon...cketV2(3pm)
π Amazon::S3::BucketV2 β the lightweight interface to various S3 methods manual, section 3pm, from the User Contributed Perl Documentation girlies β¨
okay so bestie, welcome to Amazon::S3::BucketV2 β your lil' backstage pass to the AWS S3 API. no cap, it's a whole vibe. π¦
β¨ NAME β¨
Amazon::S3::BucketV2 β a lightweight interface to various S3 methods. that's it, that's the girl. π
πΈ SYNOPSIS πΈ
here's the tea, literally just copy this:
use Amazon::S3;
use Amazon::S3::BucketV2;
my $s3 = Amazon::S3->new(
{ aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key,
}
);
my $s3 = Amazon::S3->new();
my $bucket = Amazon::S3::BucketV2->new(account => $s3, bucket => 'foo');
$bucket->DeleteObject($key);
$bucket->DeleteObjects(undef,
{ Delete => { Object => [ { Key => $key, Version => $version } ] } } );
likeβ¦ two whole ways to make your $s3, one way to make your $bucket, and then you're deleting things. iconic. π
π DESCRIPTION π
A lightweight, generic interface to the AWS S3 API. Amazon::S3::BucketV2 is a subclass of Amazon::S3::Bucket. so not only do you get the methods down below, you also still get to use all the convenience methods the parent class is serving. it's giving nepo baby but in a good way, she inherited everything and earned her own bag too. π
β οΈ heads up bestie: this is an experimental implementation and may change in the future. don't build your whole personality on it without a vibe check, k?
Every method listed below gets called with a list β or a hash reference β of key/value pairs. depending on what you need and which API you're hitting, some of these keys are optional. may not be required. read the room (and the API docs) fr fr. π«Ά
keyβ the key in the S3 bucket. yeah. the key. in the bucket.bodyβ the request body. this should be a hash ref which gets converted into an XML payload that gets sent with the request.
you gotta review the required payload for whatever API you're invoking and hand over the appropriate Perl object to be converted into XML.
wanna see how your Perl object will be serialized? call the create_xml method. slay.
for example, the DeleteObjects API takes a payload that looks like this:
<Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Object>
<Key>string</Key>
<VersionId>string</VersionId>
</Object>
...
<Quiet>boolean</Quiet>
</Delete>
the corresponding Perl object would be created like this:
my $content = {
Delete => {
Object => [
{ Key => '/foo',
VersionId => 'OYcLXagmS.WaD..oyH4KRguB95_YhLs7'
}
]
}
};
β¦and to verify how that Perl object would be serialized as XML:
use Amazon::S3::Util qw(create_xml_request);
my $content = {
Delete => {
Object => [
{ Key => '/foo',
VersionId => 'OYcLXagmS.WaD..oyH4KRguB95_YhLs7'
}
]
}
};
print create_xml_request($content);
uri_paramsβ a hash ref of extra query string parameters. lil' bonus params, as a treat. β¨headersβ a hash ref of extra headers to send along with the request. the API methods will automatically add the required headers for most calls. go read the API specs to figure out how to send any additional headers you might need. π§
Example:
$bucket->DeleteObject(key => $key);
$bucket->DeleteObject(key => $key, uri_param => { versionId => $version });
my $content
= { Delete => { Object => [ { Key => $key, Version => $version } ] } };
$bucket->DeleteObject(body => $content);
π METHODS AND SUBROUTINES π
every method below can be called in snake_case or CamelCase β she's bilingual, she contains multitudes. π
for the actual documentation on each method, consult the official AWS S3 API guide:
<https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html>
π₯ delete_bucket
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html>
π₯ delete_bucket_analytics_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html>
π₯ delete_bucket_cors
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html>
π₯ delete_bucket_encryption
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html>
π₯ delete_bucket_intelligent_tiering
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTiering.html>
π₯ delete_bucket_inventory_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html>
π₯ delete_bucket_lifecycle
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html>
π₯ delete_bucket_metrics_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html>
π₯ delete_bucket_ownership_controls
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html>
π₯ delete_bucket_policy
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html>
π₯ delete_bucket_replication
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html>
π₯ delete_bucket_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html>
π₯ delete_bucket_website
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html>
π₯ delete_object
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html>
π₯ delete_objects
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html>
π₯ delete_object_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html>
π₯ delete_public_access_block
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html>
β get_bucket_accelerate_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html>
β get_bucket_acl
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html>
β get_bucket_analytics
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalytics.html>
β get_bucket_cors
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html>
β get_bucket_encryption
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html>
β get_bucket_intelligent_tiering_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html>
β get_bucket_inventory_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html>
β get_bucket_lifecycle_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html>
β get_bucket_location
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html>
β get_bucket_logging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html>
β get_bucket_metrics_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html>
β get_bucket_notification_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html>
β get_bucket_ownership_controls
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html>
β get_bucket_policy
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html>
β get_bucket_policy_status
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html>
β get_bucket_replication
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html>
β get_bucket_request_payment
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html>
β get_bucket_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html>
β get_bucket_versioning
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html>
β get_bucket_website
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html>
β get_object_acl
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html>
β get_object_attributes
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html>
β get_object_legal_hold
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html>
β get_object_lock_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html>
β get_object_retention
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html>
β get_object_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html>
β get_object_torrent
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTorrent.html>
β get_public_access_block
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html>
π put_bucket_cors
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html>
π put_bucket_encryption
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html>
π put_bucket_intelligent_tiering_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html>
π put_bucket_lifecycle
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html>
π put_bucket_lifecycle_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html>
π put_bucket_replication_configuration
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplicationConfiguration.html>
π put_bucket_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html>
π put_bucket_versioning
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html>
π put_object
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html>
π put_object_acl
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html>
π put_object_legal_hold
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html>
π put_object_lock_configuraiton
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguraiton.html>
π«£ not me pointing out that yes,put_object_lock_configuraitonis spelled exactly like that, and the URL ends inAPI_PutObjectLockConfiguraiton.htmltoo. i'm not fixing it, i'm not judging, i'm just the messenger bestie. type it exactly like this or it will not work. π
π put_object_retention
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html>
π put_object_tagging
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html>
π put_public_access_block
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html>
π¦ restore_object
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html>
π¦ upload_part
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html>
π¦ upload_part_copy
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html>
π SEE OTHER π
Amazon::S3Amazon::S3::Bucket
go read those too, they're the family. the parent class is literally serving convenience methods the whole time, so show some respect. π
π AUTHOR π
Rob Lauer β <bigfoot@cpan.org>
and that's the whole page, bestie, you ate. π this lil' cutie came to you via perl v5.40.1, dated 2025-12-20, straight out of the User Contributed Perl Documentation corner of the internet. mwah. πβ¨
π¦ where this page comes from
- ubuntu resolute: libamazon-s3-perl 2.0.2-1 Β· Artistic-1.0-Perl
- ubuntu stonking: libamazon-s3-perl 2.0.2-1 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms