INNER CODE UNIT · TypeScript
getRegion
amplify-education/serverless-domain-manager · src/globals.ts:99
public static getRegion () {
const slsRegion = Globals.options.region || Globals.serverless.service.provider.region;
return slsRegion || Globals.currentRegion || Globals.defaultRegion;
}
public static async getProfileCreds (profile: string) {
return await fromIni({ profile })();
}
public static getRetryStrategy (attempts: number = 5, delay: number = 3000, backoff: number = 500) {
return new ConfiguredRetryStrategy(
attempts, // max attempts.
// This example sets the backoff at 500ms plus 3s per attempt.
// https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_util_retry.html#aws-sdkutil-retry
(attempt: number) => backoff + attempt * delay // backoff function.
);
}