Changeset 167

Show
Ignore:
Timestamp:
01/19/08 14:03:49 (8 months ago)
Author:
mart
Message:

added the aws_location option to set the datacenter location for
S3 targets.

The Amazon S3 target now depends on version 0.41 of Net::Amazon::S3.

Patch from Alessandro Ranellucci.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Changes

    r166 r167  
     1  - added the aws_location option to set the datacenter location for 
     2    S3 targets. from Alessandro Ranellucci <aar@cpan.org>. 
     3    The Amazon S3 target now depends on version 0.41 of Net::Amazon::S3. 
     4 
    15  - fixed tempfile creation in gc (orphaned files were left in the  
    26    working directory). from Alessandro Ranellucci <aar@cpan.org>. 
  • trunk/lib/Brackup/Target/Amazon.pm

    r165 r167  
    33use warnings; 
    44use base 'Brackup::Target'; 
    5 use Net::Amazon::S3 0.37
     5use Net::Amazon::S3 0.41
    66 
    77# fields in object: 
     
    1010#   sec_access_key_id 
    1111#   prefix 
     12#   location 
    1213#   chunk_bucket : $self->{prefix} . "-chunks"; 
    1314#   backup_bucket : $self->{prefix} . "-backups"; 
     
    2324        or die "No 'aws_secret_access_key'"; 
    2425    $self->{prefix} = $confsec->value("aws_prefix") || $self->{access_key_id}; 
     26    $self->{location} = $confsec->value("aws_location") || undef; 
    2527 
    2628    $self->_common_s3_init; 
     
    3032 
    3133    unless (grep { $_->{bucket} eq $self->{chunk_bucket} } @{ $buckets->{buckets} }) { 
    32         $s3->add_bucket({ bucket => $self->{chunk_bucket} }) 
     34        $s3->add_bucket({ bucket => $self->{chunk_bucket}, location_constraint => $self->{location} }) 
    3335            or die "Chunk bucket creation failed\n"; 
    3436    } 
    3537 
    3638    unless (grep { $_->{bucket} eq $self->{backup_bucket} } @{ $buckets->{buckets} }) { 
    37         $s3->add_bucket({ bucket => $self->{backup_bucket} }) 
     39        $s3->add_bucket({ bucket => $self->{backup_bucket}, location_constraint => $self->{location} }) 
    3840            or die "Backup bucket creation failed\n"; 
    3941    } 
     
    238240Brackup. If not specified it defaults to the AWS access key id. 
    239241 
     242=item B<aws_location> 
     243 
     244Sets the location constraint of the new buckets. If left unspecified, the 
     245default S3 datacenter location will be used. Otherwise, you can set it 
     246to 'EU' for an AWS European data center - note that costs are different. 
     247This has only effect when your backup environment is initialized in S3 (i.e. 
     248when buckets are created). If you want to move an existing backup environment 
     249to another datacenter location, you have to delete its buckets before or create 
     250a new one by specifing a different I<aws_prefix>. 
     251 
    240252=back 
    241253