I came across this problem while I was configuring S3 backups for a clients website. Our clients server is located in Finland so it would be handy to have the backups stored in the EU (Ireland) bucket rather than moving the files all over to the US Standard bucket.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salmino created an issue. See original summary.

salmino’s picture

My solution is quite simple and it doesn't come with a fancy select list or anything like that for the GUI. Instead you just paste in the endpoint of your bucket or region and voilà—it should work.

Instead of setting the value property:

  $form['host']['#type'] = 'value';
  $form['host']['#value'] = 's3.amazonaws.com';

I'm setting the default_value property:

  $form['host']['#title'] = 'Endpoint';
  $form['host']['#default_value'] =  $this->get_host();
  $form['host']['#description'] = 'Select an endpoint for your region (e.g., s3.amazonaws.com, s3-eu-west-1.amazonaws.com).';

Here's the function that is being called to get the default_value property:

  function get_host() {
    $parts = explode('/', @$this->dest_url['host']);
    return $parts[0];
  }

To find the endpoint for the region your bucket is located in: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

couturier’s picture

Status: Active » Needs work

This module may or may not need to be rewritten based on the newest 7.x-3.2 version.

DamienMcKenna’s picture

Status: Needs work » Needs review

Lets see if the patch passes the tests.

DamienMcKenna’s picture

Status: Needs review » Closed (duplicate)
Parent issue: » #2942331: Plan for Backup and Migrate 7.x-3.6
Related issues: +#2404113: Different host for AWS type server

Marking this a duplicate of #2404113: Different host for AWS type server, but salmino gets some credit for the patch.