code: def get_config_values(
      self, config: AWSConfigInfoWithCredsPartial
  ) -> AWSConfigValues:
      config_values = AWSConfigValues(regions=None)
      config_values.default_creds = (
          settings.DEFAULT_CREDS_ENABLED
          and auth.default_creds_available()
      )
      if config.creds is None:
          return config_values
      if (
          isinstance(config.creds, AWSDefaultCreds)
          and not settings.DEFAULT_CREDS_ENABLED
      ):
          raise_invalid_credentials_error(fields=[["creds"]])
      try:
          auth.authenticate(creds=config.creds, region=MAIN_REGION)
      except:
          if isinstance(config.creds, AWSAccessKeyCreds):
              raise_invalid_credentials_error(
                  fields=[
                      ["creds", "access_key"],
                      ["creds", "secret_key"],
                  ]
              )
          else:
              raise_invalid_credentials_error(fields=[["creds"]])
      config_values.regions = self._get_regions_element(
          selected=config.regions or DEFAULT_REGIONS
      )
      return config_values
  
file_path: dstack/src/dstack/_internal/server/services/backends/configurators/aws.py
imports: import json
  from typing import List, Optional
  from dstack._internal.core.backends.aws import AWSBackend, auth
  from dstack._internal.core.backends.aws.config import AWSConfig
  from dstack._internal.core.errors import BackendAuthError
  from dstack._internal.core.models.backends.aws import AnyAWSConfigInfo, AWSAccessKeyCreds, AWSConfigInfo, AWSConfigInfoWithCreds, AWSConfigInfoWithCredsPartial, AWSConfigValues, AWSCreds, AWSDefaultCreds, AWSStoredConfig
  from dstack._internal.core.models.backends.base import BackendType, ConfigElementValue, ConfigMultiElement
  from dstack._internal.server import settings
  from dstack._internal.server.models import BackendModel, ProjectModel
  from dstack._internal.server.services.backends.configurators.base import Configurator, raise_invalid_credentials_error
label_desc: Use image node_id 2 for calling the AWSConfigurator obj's underlying member method code with example usage: obj.get_config_values(config) and returns: config_values, config_values