Skip to content

Commit

Permalink
fix(AWS IAM): Report missing RoleName on custom role (#8219)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWells committed Oct 7, 2020
1 parent faa1dce commit 60cfa75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/plugins/aws/deployFunction/index.js
Expand Up @@ -77,8 +77,10 @@ class AwsDeployFunction {
if (roleResource.Type !== 'AWS::IAM::Role') {
throw new Error('Provided resource is not IAM Role.');
}

const roleProperties = roleResource.Properties;
if (!roleProperties.RoleName) {
throw new this.serverless.classes.Error('Role resource missing RoleName property');
}
const compiledFullRoleName = `${roleProperties.Path || '/'}${roleProperties.RoleName}`;

return this.provider
Expand Down

0 comments on commit 60cfa75

Please sign in to comment.