Amazon-S3-Lite

 view release on metacpan or  search on metacpan

lib/Amazon/S3/Lite.pm  view on Meta::CPAN

L</LAMBDA USAGE NOTES>.

=head2 create_bucket

  $s3->create_bucket($bucket);
  $s3->create_bucket($bucket, region => 'eu-west-1', acl => 'private');

Creates a new S3 bucket. Options:

=over 4

=item region

The region in which to create the bucket. Defaults to the region the
object was constructed with. B<Note:> C<us-east-1> is S3's implicit
default - the C<CreateBucketConfiguration> body is intentionally
omitted for that region as including it causes a C<InvalidLocationConstraint>
error. For all other regions the C<LocationConstraint> element is
sent automatically.

=item acl

Canned ACL string, e.g. C<private> (the S3 default), C<public-read>.

=back

Returns true on success. Croaks on failure.

=head2 delete_bucket

  $s3->delete_bucket($bucket);
  $s3->delete_bucket($bucket, region => 'us-west-2');

Deletes an empty bucket. Returns a true value on success. S3 refuses
to delete a bucket that still contains objects, so callers must empty
the bucket first (for example by iterating L</list_all_objects_v2> and
calling L</delete_object> on each key).

=over 4

=item region

Override the region the delete is signed against. Defaults to the
region the object was constructed with.

=back

=head2 put_public_access_block

  $s3->put_public_access_block($bucket);
  $s3->put_public_access_block(
    $bucket,
    block_public_acls       => 1,
    ignore_public_acls      => 1,
    block_public_policy      => 0,
    restrict_public_buckets => 0,
  );

Sets the Block Public Access configuration on a bucket. Each of the
four settings is a boolean; any setting not supplied B<defaults to
true> (fully locked down), so an argument-less call blocks all public
access. Returns a true value on success.

=over 4

=item block_public_acls

=item ignore_public_acls

=item block_public_policy

=item restrict_public_buckets

Each accepts a true/false value. Omitted settings default to true.
Note that hosting content publicly (for example a static website, or
a policy-scoped private bucket that grants anonymous C<GetObject> from
a VPC endpoint) requires the relevant setting to be false so the
bucket policy is not rejected.

=back

=head2 put_bucket_website

  $s3->put_bucket_website($bucket);
  $s3->put_bucket_website($bucket, index => 'index.html', error => 'error.html');

Configures the bucket as an S3 static website endpoint. Returns a true
value on success.

=over 4

=item index

The index document suffix. Defaults to C<index.html>.

=item error

The error document key. Optional; when omitted, no error document is
configured.

=back

=head2 get_bucket_website

  my $config = $s3->get_bucket_website($bucket);

Returns the bucket's website configuration as a hashref, or C<undef>
if the bucket has no website configuration. The hashref contains
whichever of the following are set:

=over 4

=item index_document

The index document suffix.

=item error_document

The error document key.

=item redirect_all_requests_to



( run in 1.008 second using v1.01-cache-2.11-cpan-800906f7e73 )