Skip to content

Commit

Permalink
Use options for Stage & Region
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerikson committed Oct 7, 2016
1 parent 05b3d51 commit 77ab041
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/plugins/aws/deploy/lib/configureStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ function addDefaultRoleAndPolicy() {
iamPolicyLambdaExecutionTemplate
.IamPolicyLambdaExecution
.Properties
.PolicyName = `${this.serverless.config.stage}-${this.serverless.service.service}-lambda`;
.PolicyName = `${this.options.stage}-${this.serverless.service.service}-lambda`;

iamPolicyLambdaExecutionTemplate
.IamPolicyLambdaExecution
.Properties
.PolicyDocument
.Statement[0]
.Resource = `arn:aws:logs:${this.serverless.config.region}:*:*`;
.Resource = `arn:aws:logs:${this.options.region}:*:*`;

_.merge(this.serverless.service.provider.compiledCloudFormationTemplate.Resources,
iamPolicyLambdaExecutionTemplate);
Expand Down Expand Up @@ -128,11 +128,11 @@ function addDeploymentBucket() {
{
Bucket: bucketName,
},
this.serverless.config.stage,
this.serverless.config.region
this.options.stage,
this.options.region
))
.then(result => {
if (result.LocationConstraint !== this.serverless.config.region) {
if (result.LocationConstraint !== this.options.region) {
throw new this.serverless.classes.Error(
'Deployment bucket is not in the same region as the lambda function'
);
Expand Down

0 comments on commit 77ab041

Please sign in to comment.