From cd281f62a960124da3bd9606653ecbdb55b7c4d0 Mon Sep 17 00:00:00 2001 From: Austen Collins Date: Fri, 4 Dec 2015 16:35:26 -0800 Subject: [PATCH] ProjectCreate: Remove apiFunctionAlias from project.stage.region objects. Project/Stage/Region: Replace projectBucket term w/ regionBucket --- lib/actions/ProjectCreate.js | 13 ++++++------- lib/actions/RegionCreate.js | 5 ----- lib/actions/StageCreate.js | 13 ++++++------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/actions/ProjectCreate.js b/lib/actions/ProjectCreate.js index 5d300da6f..c9828a470 100644 --- a/lib/actions/ProjectCreate.js +++ b/lib/actions/ProjectCreate.js @@ -350,7 +350,7 @@ class ProjectCreate extends SPlugin { } // Set Serverless Regional Bucket - this._projectBucket = SUtils.generateRegionBucketName(this.evt.region, this.evt.domain); + this._regionBucket = SUtils.generateRegionBucketName(this.evt.region, this.evt.domain); return BbPromise.resolve(); } @@ -404,8 +404,8 @@ class ProjectCreate extends SPlugin { */ _createProjectBucket() { - SCli.log('Creating a project region bucket on S3: ' + this._projectBucket + '...'); - return this.S3.sCreateBucket(this._projectBucket); + SCli.log('Creating a project region bucket on S3: ' + this._regionBucket + '...'); + return this.S3.sCreateBucket(this._regionBucket); } /** @@ -419,7 +419,7 @@ class ProjectCreate extends SPlugin { SERVERLESS_DATA_MODEL_STAGE=${stage}`; return this.S3.sPutEnvFile( - this._projectBucket, + this._regionBucket, this.evt.name, this.evt.stage, envFileContents); @@ -432,7 +432,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`; _putCfFile() { return this.CF.sPutCfFile( this._projectRootPath, - this._projectBucket, + this._regionBucket, this.evt.name, this.evt.stage, 'resources'); @@ -502,8 +502,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`; prjJson.stages[_this.evt.stage] = [{ region: _this.evt.region, iamRoleArnLambda: iamRoleArnLambda || '', - regionBucket: _this._projectBucket, - apiFunctionAlias: 'LATEST', + regionBucket: _this._regionBucket }]; prjJson.name = _this.evt.name; diff --git a/lib/actions/RegionCreate.js b/lib/actions/RegionCreate.js index 340108932..1175c55f9 100644 --- a/lib/actions/RegionCreate.js +++ b/lib/actions/RegionCreate.js @@ -311,13 +311,8 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`; region: _this.evt.region, iamRoleArnLambda: '', regionBucket: _this.evt.projectBucket, - apiFunctionAlias: 'LATEST', }; - // Get apiFunctionAlias from another region in this stage - let region = _this.S._projectJson.stages[_this.evt.stage][0]; - if (region.apiFunctionAlias) regionObj.apiFunctionAlias = region.apiFunctionAlias; - if (cfStackData) { for (let i = 0; i < cfStackData.Outputs.length; i++) { if (cfStackData.Outputs[i].OutputKey === 'IamRoleArnLambda') { diff --git a/lib/actions/StageCreate.js b/lib/actions/StageCreate.js index 5b594c92a..f3d2e2677 100644 --- a/lib/actions/StageCreate.js +++ b/lib/actions/StageCreate.js @@ -260,9 +260,9 @@ usage: serverless stage create`, _createProjectBucket() { - this._projectBucket = SUtils.generateRegionBucketName(this.evt.stage, this.evt.region, this.S._projectJson.domain); - SCli.log('Creating a region bucket on S3: ' + this._projectBucket + '...'); - return this.S3.sCreateBucket(this._projectBucket); + this._regionBucket = SUtils.generateRegionBucketName(this.evt.stage, this.evt.region, this.S._projectJson.domain); + SCli.log('Creating a region bucket on S3: ' + this._regionBucket + '...'); + return this.S3.sCreateBucket(this._regionBucket); } @@ -278,7 +278,7 @@ usage: serverless stage create`, SERVERLESS_DATA_MODEL_STAGE=${stage}`; return this.S3.sPutEnvFile( - this._projectBucket, + this._regionBucket, this.S._projectJson.name, this.evt.stage, envFileContents); @@ -291,7 +291,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`; _putCfFile() { return this.CF.sPutCfFile( this.S._projectRootPath, - this._projectBucket, + this._regionBucket, this.S._projectJson.name, this.evt.stage, 'resources'); @@ -345,8 +345,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`; regionObj = { region: _this.evt.region, iamRoleArnLambda: '', - regionBucket: _this._projectBucket, - apiFunctionAlias: 'LATEST', + regionBucket: _this._regionBucket, }; if (cfStackData) {