@@ -7,6 +7,7 @@ import { EC2Client } from '@aws-sdk/client-ec2';
77import { InlineProgramArgs } from '@pulumi/pulumi/automation' ;
88import { KMSClient } from '@aws-sdk/client-kms' ;
99import { RDSClient } from '@aws-sdk/client-rds' ;
10+ import { requireEnv } from '../util' ;
1011import { testDefaultDb } from './default-db.test' ;
1112
1213const programArgs : InlineProgramArgs = {
@@ -15,22 +16,18 @@ const programArgs: InlineProgramArgs = {
1516 program : ( ) => import ( './infrastructure' ) ,
1617} ;
1718
18- describe ( 'Database component deployment' , ( ) => {
19- const region = process . env . AWS_REGION ;
20- if ( ! region ) {
21- throw new Error ( 'AWS_REGION environment variable is required' ) ;
22- }
23-
24- const ctx : DatabaseTestContext = {
25- outputs : { } ,
26- config,
27- clients : {
28- rds : new RDSClient ( { region } ) ,
29- ec2 : new EC2Client ( { region } ) ,
30- kms : new KMSClient ( { region } ) ,
31- } ,
32- } ;
19+ const region = requireEnv ( 'AWS_REGION' ) ;
20+ const ctx : DatabaseTestContext = {
21+ outputs : { } ,
22+ config,
23+ clients : {
24+ rds : new RDSClient ( { region } ) ,
25+ ec2 : new EC2Client ( { region } ) ,
26+ kms : new KMSClient ( { region } ) ,
27+ } ,
28+ } ;
3329
30+ describe ( 'Database component deployment' , ( ) => {
3431 before ( async ( ) => {
3532 ctx . outputs = await automation . deploy ( programArgs ) ;
3633 } ) ;
0 commit comments