Remove iamRoleARN support

This commit is contained in:
Philipp Muens 2016-11-04 13:25:11 +01:00
parent 305670f012
commit f3c478b50b
3 changed files with 4 additions and 25 deletions

View File

@ -153,7 +153,7 @@ functions:
memorySize: 512
```
You can also use an existing IAM role by adding your IAM Role ARN in the `iamRoleARN` property. For example:
You can also use an existing IAM role by adding your IAM Role ARN in the `role` property. For example:
```yml
# serverless.yml
@ -161,10 +161,10 @@ You can also use an existing IAM role by adding your IAM Role ARN in the `iamRol
service: new-service
provider:
name: aws
iamRoleARN: arn:aws:iam::YourAccountNumber:role/YourIamRole
role: arn:aws:iam::YourAccountNumber:role/YourIamRole
```
Support for separate IAM Roles per function is coming soon.
See the documentation about [IAM](./iam.md) for function level IAM roles.
## VPC Configuration

View File

@ -21,7 +21,7 @@ module.exports = {
}
if (!anyFunctionHasNoRole) return BbPromise.resolve();
if (typeof this.serverless.service.provider.iamRoleARN !== 'string') {
if (typeof this.serverless.service.provider.role !== 'string') {
// merge in the iamRoleLambdaTemplate
const iamRoleLambdaExecutionTemplate = this.serverless.utils.readFileSync(
path.join(this.serverless.config.serverlessPath,

View File

@ -112,27 +112,6 @@ describe('#mergeIamTemplates()', () => {
});
});
it('should not add IamPolicyLambdaExecution if arn is provided', () => {
awsDeploy.serverless.service.provider.iamRoleARN = 'some:aws:arn:xxx:*:*';
return awsDeploy.mergeIamTemplates()
.then(() => expect(
awsDeploy.serverless.service.provider.compiledCloudFormationTemplate
.Resources.IamPolicyLambdaExecution
).to.not.exist);
});
it('should not add IamRole if arn is provided', () => {
awsDeploy.serverless.service.provider.iamRoleARN = 'some:aws:arn:xxx:*:*';
return awsDeploy.mergeIamTemplates()
.then(() => expect(
awsDeploy.serverless.service.provider.compiledCloudFormationTemplate
.Resources.IamRoleLambdaExecution
).to.not.exist);
});
it('should add a CloudWatch LogGroup resource', () => {
awsDeploy.serverless.service.provider.cfLogs = true;
const normalizedName = `${functionName[0].toUpperCase()}${functionName.substr(1)}LogGroup`;