Commit 328c234a authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3306981 by yas: Add the location of the UAE region (me-central-1)

parent 8f55cf88
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -3737,3 +3737,22 @@ function aws_cloud_update_8271(): void {
  ];
  \Drupal::service('cloud')->updateYmlDefinitions($files, 'aws_cloud');
}

/**
 * Add AWS Cloud region location configuration items.
 */
function aws_cloud_update_8272(): void {
  $config_path = \Drupal::service('extension.path.resolver')->getPath('module', 'aws_cloud') . '/config/install';

  $filename = $config_path . '/aws_cloud.settings.yml';
  $file = file_get_contents($filename);
  if ($file) {
    $values = Yaml::decode($file);
    if (!empty($values) && is_array($values) && isset($values['aws_cloud_region_locations'])) {
      $config_factory = \Drupal::configFactory();
      $config = $config_factory->getEditable('aws_cloud.settings');
      $config->set('aws_cloud_region_locations', $values['aws_cloud_region_locations']);
      $config->save();
    }
  }
}
+5 −0
Original line number Diff line number Diff line
@@ -147,6 +147,11 @@ aws_cloud_region_locations:
    city: Paris
    latitude: '48.856614'
    longitude: '2.352222'
  me-central-1:
    country: AE
    city: Dubai
    latitude: '25.1547'
    longitude: '55.1750'
  me-south-1:
    country: BH
    city: Bahrain