diff --git a/lib/commands/deploy_endpoint.js b/lib/commands/deploy_endpoint.js index 22fa6c0fa..f8e263bdd 100644 --- a/lib/commands/deploy_endpoint.js +++ b/lib/commands/deploy_endpoint.js @@ -398,8 +398,12 @@ ApiDeployer.prototype._findOrCreateApi = Promise.method(function() { } else { // Create REST API + + var apiName = _this._prjJson.name + '-' + _this._stage; + apiName = apiName.substr( 0, 1023 ); // keep the name length below the limits + return _this.ApiClient.createRestApi({ - name: _this._prjJson.name, + name: apiName, description: _this._prjJson.description ? _this._prjJson.description : 'A REST API for a JAWS project.', }).then(function(response) {