AWS::S3::Bucket - Object representation of S3 Buckets
See The SYNOPSIS from AWS::S3 for usage details.
Call new() with the following parameters.
new()
Required. An AWS::S3 object.
Read-only.
Required. String.
The name of the bucket.
String. Returned from the S3 service itself.
String. Returns XML string.
See also PUT Bucket ACL
String. Read-only.
EU
us-west-1
us-west-2
ap-southeast-1
ap-northeast-1
The default value is undef which means 'US'.
See also PUT Bucket
Read-only. String of JSON.
Looks something like this:
{ "Version":"2008-10-17", "Id":"aaaa-bbbb-cccc-dddd", "Statement" : [ { "Effect":"Deny", "Sid":"1", "Principal" : { "AWS":["1-22-333-4444","3-55-678-9100"] }, "Action":["s3:*"], "Resource":"arn:aws:s3:::bucket/*", } ] }
See also GET Bucket Policy
Returns a AWS::S3::FileIterator object with the supplied arguments.
Use the AWS::S3::FileIterator to page through your results.
Finds the file with that $key and returns an AWS::S3::File object for it.
$key
Given an ArrayRef of the keys you want to delete, delete_multi can only delete up to 1000 keys at once. Empty your buckets for deletion quickly like this:
delete_multi
my $deleted = 0; my $bucket = $s->bucket( 'foobar' ); my $iter = $bucket->files( page_size => 1000, page_number => 1 ); while( my @files = $iter->next_page ) { $bucket->delete_multi( map { $_->key } @files ); $deleted += @files; # Reset to page 1: $iter->page_number( 1 ); warn "Deleted $deleted files so far\n"; }# end while() # NOW you can delete your bucket (if you want) because it's empty: $bucket->delete;
The Amazon S3 API Documentation
AWS::S3::Bucket
AWS::S3::File
AWS::S3::FileIterator
AWS::S3::Owner
To install AWS::S3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AWS::S3
CPAN shell
perl -MCPAN -e shell install AWS::S3
For more information on module installation, please visit the detailed CPAN module installation guide.