@@ -196,24 +196,33 @@ class ServerlessComponent extends Component {
196196 outputs . templateUrl = CONFIGS . templateUrl
197197 }
198198
199- const deployTasks = [ this . deployFunction ( credentials , functionConf , regionList , outputs ) ]
199+ let apigwOutputs
200+ const functionOutputs = await this . deployFunction (
201+ credentials ,
202+ functionConf ,
203+ regionList ,
204+ outputs
205+ )
200206 // support apigatewayConf.isDisabled
201207 if ( apigatewayConf . isDisabled !== true ) {
202- deployTasks . push ( this . deployApigateway ( credentials , apigatewayConf , regionList , outputs ) )
208+ apigwOutputs = await this . deployApigateway ( credentials , apigatewayConf , regionList , outputs )
203209 } else {
204210 this . state . apigwDisabled = true
205211 }
206- const [ functionOutputs , apigwOutputs = { } ] = await Promise . all ( deployTasks )
207212
208213 // optimize outputs for one region
209214 if ( regionList . length === 1 ) {
210215 const [ oneRegion ] = regionList
211216 outputs . region = oneRegion
212- outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
213217 outputs [ 'scf' ] = functionOutputs [ oneRegion ]
218+ if ( apigwOutputs ) {
219+ outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
220+ }
214221 } else {
215- outputs [ 'apigw' ] = apigwOutputs
216222 outputs [ 'scf' ] = functionOutputs
223+ if ( apigwOutputs ) {
224+ outputs [ 'apigw' ] = apigwOutputs
225+ }
217226 }
218227
219228 this . state . region = regionList [ 0 ]
0 commit comments