diff --git a/modules/aws-http4s/src/smithy4s/aws/AwsClient.scala b/modules/aws-http4s/src/smithy4s/aws/AwsClient.scala index d39345427..3d36f56a4 100644 --- a/modules/aws-http4s/src/smithy4s/aws/AwsClient.scala +++ b/modules/aws-http4s/src/smithy4s/aws/AwsClient.scala @@ -71,7 +71,11 @@ object AwsClient { def baseRequest(endpoint: OperationSchema[_, _, _, _, _]): F[HttpRequest[Blob]] = { awsEnv.region.map { region => - val endpointPrefix = awsService.endpointPrefix.getOrElse(endpoint.id.name) + val endpointPrefix = + awsService.endpointPrefix + .orElse(awsService.arnNamespace.map(_.value)) + .getOrElse(endpoint.id.name) + val baseUri = HttpUri( scheme = HttpUriScheme.Https, host = s"$endpointPrefix.$region.amazonaws.com", diff --git a/modules/aws-http4s/src/smithy4s/aws/internals/AwsSigning.scala b/modules/aws-http4s/src/smithy4s/aws/internals/AwsSigning.scala index 21f55f007..6ead1d101 100644 --- a/modules/aws-http4s/src/smithy4s/aws/internals/AwsSigning.scala +++ b/modules/aws-http4s/src/smithy4s/aws/internals/AwsSigning.scala @@ -60,7 +60,10 @@ private[aws] object AwsSigning { ): Client[F] => Client[F] = { val endpointPrefix = serviceHints .get(_root_.aws.api.Service) - .flatMap(_.endpointPrefix) + .flatMap { awsService => + awsService.endpointPrefix + .orElse(awsService.arnNamespace.map(_.value)) + } .getOrElse(serviceId.name) .toLowerCase()