UNPKG

@studion/infra-code-blocks

Version:
16 lines (15 loc) 635 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveAwsRegion = resolveAwsRegion; const aws = require("@pulumi/aws"); const pulumi = require("@pulumi/pulumi"); function resolveAwsRegion({ region }, parent) { return region ? pulumi.output(region) : aws.getRegionOutput({}, { parent }).region.apply(resolvedRegion => { if (!resolvedRegion) { throw new Error('AWS region could not be resolved from the active AWS provider. Configure the AWS provider region or pass region explicitly.'); } return resolvedRegion; }); }