INNER CODE UNIT · TypeScript
getServiceEndpoint
amplify-education/serverless-domain-manager · src/globals.ts:83
public static getServiceEndpoint (service: string) {
const awsProvider = Globals.serverless.providers.aws;
// AWS SDK v3 clients resolve custom endpoints (e.g. AWS_ENDPOINT_URL_*)
// natively on osls v4, so no manual sdk.config lookup is needed there.
if (Globals.hasSdkV3Config(awsProvider)) {
return null;
}
try {
const serviceConf = awsProvider.sdk && awsProvider.sdk.config[service];
return serviceConf ? serviceConf.endpoint : null;
} catch {
// providers.aws.sdk is a removed v2 surface (osls v4); SDK v3 resolves endpoints natively
return null;
}
}
public static getRegion () {
const slsRegion = Globals.options.region || Globals.serverless.service.provider.region;