Commit 33747a3a authored by baldwinlouie's avatar baldwinlouie Committed by Yas Naoi
Browse files

Issue #3283702 by baldwinlouie, kumikoono, yas: Fix bypassing the IAM...

Issue #3283702 by baldwinlouie, kumikoono, yas: Fix bypassing the IAM permission importing code by move $aws_access_service->updatePermissions() above instance price import code
parent bb73d0ec
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3582,6 +3582,13 @@ function aws_cloud_form_cloud_config_aws_cloud_add_form_submit_finished(
      $ec2_service->setCloudContext($entity->getCloudContext());
      $ec2_service->createResourceQueueItems($entity);

      // Sync IAM permissions to be used by AwsCloudAccess.php.
      // Note: There are multiple API calls performed, and could
      // lead to some slowness, but this is accepted.
      // NOTE: do not move this code below the aws_cloud_getinstance_types
      // code.
      $aws_access_service->updatePermissions($entity->getCloudContext());

      if (empty($entity->get('field_get_price_list')->value)) {
        continue;
      }
@@ -3598,11 +3605,6 @@ function aws_cloud_form_cloud_config_aws_cloud_add_form_submit_finished(
      $ec2_service->addArchitecturesToInstanceTypes($instance_types);

      \Drupal::cache()->set($cache_key, $instance_types, Cache::PERMANENT);

      // Sync IAM permissions to be used by AwsCloudAccess.php.
      // Note: There are multiple API calls performed, and could
      // lead to some slowness, but this is accepted.
      $aws_access_service->updatePermissions($entity->getCloudContext());
    }

    // Update AvailabilityZones.