File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,13 @@ export async function vpcReplacements(props: { rawConfigStr: string }): Promise<
269269 const ouOrAccountReplacementRegex = '\\${CONFIG::OU_NAME}' ;
270270 const vpcConfigSections = [ 'workload-account-configs' , 'mandatory-account-configs' , 'organizational-units' ] ;
271271 const rawConfig = JSON . parse ( rawConfigStr ) ;
272- for ( const vpcConfigSection of vpcConfigSections ) {
272+ const existingVpcConfigSections = vpcConfigSections . filter ( vpcConfigSection => rawConfig [ vpcConfigSection ] ) ;
273+ if ( existingVpcConfigSections . length < vpcConfigSections . length ) {
274+ console . log ( 'Expected the following keys to exist' , vpcConfigSections ) ;
275+ console . log ( 'Only found the following keys' , existingVpcConfigSections ) ;
276+ throw new Error ( 'Please add the missing manditory sections to the configuration file.' ) ;
277+ }
278+ for ( const vpcConfigSection of existingVpcConfigSections ) {
273279 Object . entries ( rawConfig [ vpcConfigSection ] ) . map ( ( [ key , _ ] ) => {
274280 const replacements = {
275281 '\\${CONFIG::VPC_NAME}' : key ,
You can’t perform that action at this time.
0 commit comments