@@ -196,24 +196,33 @@ class ServerlessComponent extends Component {
196
196
outputs . templateUrl = CONFIGS . templateUrl
197
197
}
198
198
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
+ )
200
206
// support apigatewayConf.isDisabled
201
207
if ( apigatewayConf . isDisabled !== true ) {
202
- deployTasks . push ( this . deployApigateway ( credentials , apigatewayConf , regionList , outputs ) )
208
+ apigwOutputs = await this . deployApigateway ( credentials , apigatewayConf , regionList , outputs )
203
209
} else {
204
210
this . state . apigwDisabled = true
205
211
}
206
- const [ functionOutputs , apigwOutputs = { } ] = await Promise . all ( deployTasks )
207
212
208
213
// optimize outputs for one region
209
214
if ( regionList . length === 1 ) {
210
215
const [ oneRegion ] = regionList
211
216
outputs . region = oneRegion
212
- outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
213
217
outputs [ 'scf' ] = functionOutputs [ oneRegion ]
218
+ if ( apigwOutputs ) {
219
+ outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
220
+ }
214
221
} else {
215
- outputs [ 'apigw' ] = apigwOutputs
216
222
outputs [ 'scf' ] = functionOutputs
223
+ if ( apigwOutputs ) {
224
+ outputs [ 'apigw' ] = apigwOutputs
225
+ }
217
226
}
218
227
219
228
this . state . region = regionList [ 0 ]
0 commit comments