getRegionShortCode

getRegionShortCode(region: string): string

Builds the compact code used in JobCloud resource names for an AWS region.

Remarks

Each geographic segment is reduced to its first letter while preserving the AWS region number. The function validates the lowercase AWS region-name syntax only; it does not verify a region against AWS's current region catalogue or restrict callers to jobcloudAllowedRegions.

Parameters

  • region (string) — Canonical AWS region name, such as eu-west-1.

Returns

  • string — The compact region code, such as euw1.

Example

CODE
import { getRegionShortCode } from '@jobcloud/pulumi-helpers';

const regionCode = getRegionShortCode('eu-central-1'); // euc1