Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/deploy/events/apiGateway/iamRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ module.exports = {
};


const permissionsBoundary = _.get(this.serverless.service, 'provider.rolePermissionsBoundary');
if (permissionsBoundary) {
iamRoleApiGatewayToStepFunctions.Properties.PermissionsBoundary = permissionsBoundary;
}

const rolePath = _.get(this.serverless.service, 'provider.iam.role.path');
if (rolePath) {
iamRoleApiGatewayToStepFunctions.Properties.Path = rolePath;
Expand Down
21 changes: 21 additions & 0 deletions lib/deploy/events/apiGateway/iamRole.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,27 @@ describe('#compileHttpIamRole()', () => {
});
});

it('should apply provider.rolePermissionsBoundary to API Gateway IAM role', () => {
serverlessStepFunctions.pluginhttpValidated = {
events: [
{
stateMachineName: 'first',
http: {
path: 'foo/bar1',
method: 'post',
},
},
],
};
serverless.service.provider.rolePermissionsBoundary = 'arn:aws:iam::123456789:policy/DeveloperBoundaryPolicy';

return serverlessStepFunctions.compileHttpIamRole().then(() => {
const properties = serverlessStepFunctions.serverless.service.provider
.compiledCloudFormationTemplate.Resources.ApigatewayToStepFunctionsRole.Properties;
expect(properties.PermissionsBoundary).to.equal('arn:aws:iam::123456789:policy/DeveloperBoundaryPolicy');
});
});

it('should apply provider.iam.role.path to API Gateway IAM role', () => {
serverlessStepFunctions.pluginhttpValidated = {
events: [
Expand Down
Loading