@@ -186,19 +186,19 @@ module.exports = function(currentTemplate, aliasStackTemplates, currentAliasStac
186
186
this . options . verbose && this . _serverless . cli . log ( 'Configuring stage' ) ;
187
187
const stageResource = internal . createStageResource . call ( this , `${ stackName } -ApiGatewayRestApi` , deploymentName ) ;
188
188
aliasResources . push ( { ApiGatewayStage : stageResource } ) ;
189
- }
190
-
191
- const baseMapping = _ . assign ( { } , _ . pickBy ( stageStack . Resources , [ 'Type' , 'AWS::ApiGateway::BasePathMapping' ] ) ) ;
192
- if ( ! _ . isEmpty ( baseMapping ) ) {
193
- const baseMappingName = _ . keys ( baseMapping ) [ 0 ] ;
194
- const obj = baseMapping [ baseMappingName ] ;
189
+
190
+ const baseMapping = _ . assign ( { } , _ . pickBy ( stageStack . Resources , [ 'Type' , 'AWS::ApiGateway::BasePathMapping' ] ) ) ;
191
+ if ( ! _ . isEmpty ( baseMapping ) ) {
192
+ const baseMappingName = _ . keys ( baseMapping ) [ 0 ] ;
193
+ const obj = baseMapping [ baseMappingName ] ;
195
194
196
- delete obj . Properties . StageName ;
197
- obj . Properties . RestApiId = { 'Fn::ImportValue' : `${ stackName } -ApiGatewayRestApi` } ;
195
+ obj . Properties . StageName = { Ref : 'ApiGatewayStage' } ;
196
+ obj . Properties . RestApiId = { 'Fn::ImportValue' : `${ stackName } -ApiGatewayRestApi` } ;
198
197
199
- aliasResources . push ( baseMapping ) ;
200
- delete stageStack . Resources [ baseMappingName ] ;
201
- }
198
+ aliasResources . push ( baseMapping ) ;
199
+ delete stageStack . Resources [ baseMappingName ] ;
200
+ }
201
+ }
202
202
203
203
// Fetch lambda permissions, methods and resources. These have to be updated later to allow the aliased functions.
204
204
const apiLambdaPermissions =
0 commit comments