UNPKG

serverless

Version:

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

45 lines (40 loc) 1.28 kB
'use strict'; const _ = require('lodash'); module.exports = { compileDeployment() { this.apiGatewayDeploymentLogicalId = this.provider.naming.generateApiGatewayDeploymentLogicalId( this.serverless.instanceId ); _.merge(this.serverless.service.provider.compiledCloudFormationTemplate.Resources, { [this.apiGatewayDeploymentLogicalId]: { Type: 'AWS::ApiGateway::Deployment', Properties: { RestApiId: this.provider.getApiGatewayRestApiId(), StageName: this.provider.getStage(), Description: this.provider.getApiGatewayDescription(), }, DependsOn: this.apiGatewayMethodLogicalIds, }, }); // create CLF Output for endpoint _.merge(this.serverless.service.provider.compiledCloudFormationTemplate.Outputs, { ServiceEndpoint: { Description: 'URL of the service endpoint', Value: { 'Fn::Join': [ '', [ 'https://', this.provider.getApiGatewayRestApiId(), '.execute-api.', { Ref: 'AWS::Region' }, '.', { Ref: 'AWS::URLSuffix' }, `/${this.provider.getStage()}`, ], ], }, }, }); }, };