buildAvailabilityZonesRecord

buildAvailabilityZonesRecord( region: 'eu-central-1' | 'eu-west-1' | 'us-east-1', numberOfAvailabilityZones: number, ): Record<string, string>

Builds the keyed availability-zone record accepted by AwsVpc capabilities.

Remarks

Each selected availability-zone name is both the stable record key and its AWS availability-zone value. The requested count selects the leading zones from the curated regional ordering.

Parameters

  • region ("eu-central-1" | "eu-west-1" | "us-east-1") — Organisation-enabled AWS region.
  • numberOfAvailabilityZones (number) — Positive number of availability zones to include.

Returns

  • Record<string, string> — A keyed availability-zone record compatible with AwsVpcAvailabilityZones.

Example

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

const availabilityZones = buildAvailabilityZonesRecord('eu-west-1', 2);
// { 'eu-west-1a': 'eu-west-1a', 'eu-west-1b': 'eu-west-1b' }