Typically, the pattern for AWS service's endpoints is {service}.amazonaws.com (or {service}.{region}.amazonaws.com). In some cases like with Bedrock, there are two separate endpoint: bedrock for management, and bedrock-runtime for accessing the AI models. However, the credentials need to always scoped to the service, for which the using() method was established.
This PR adds a shorthand for having to repeat the region and top-level domain in this case by passing the prefix ending with a ".":
use com\amazon\aws\{ServiceEndpoint, CredentialProvider};
// Before
$runtime= (new ServiceEndpoint('bedrock', CredentialProvider::default()))
->using('bedrock-runtime.eu-central-1.amazonaws.com')
->in('eu-central-1')
;
// After
$runtime= (new ServiceEndpoint('bedrock', CredentialProvider::default()))
->using('bedrock-runtime.')
->in('eu-central-1')
;
Typically, the pattern for AWS service's endpoints is {service}.amazonaws.com (or {service}.{region}.amazonaws.com). In some cases like with Bedrock, there are two separate endpoint: bedrock for management, and bedrock-runtime for accessing the AI models. However, the credentials need to always scoped to the service, for which the
using()
method was established.This PR adds a shorthand for having to repeat the region and top-level domain in this case by passing the prefix ending with a ".":