Skip to content

Commit

Permalink
update grant error message
Browse files Browse the repository at this point in the history
  • Loading branch information
humanzz committed Sep 9, 2022
1 parent 58479b0 commit 3d369be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-neptune/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export abstract class DatabaseClusterBase extends Resource implements IDatabaseC

public grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant {
if (this.enableIamAuthentication === false) {
throw new Error('Cannot grant permissions as IAM authentication is disabled');
throw new Error('Cannot grant permissions when IAM authentication is disabled');
}

this.enableIamAuthentication = true;
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-neptune/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ describe('DatabaseCluster', () => {
});

// THEN
expect(() => { cluster.grantConnect(role); }).toThrow(/Cannot grant permissions as IAM authentication is disabled/);
expect(() => { cluster.grantConnect(role); }).toThrow(/Cannot grant permissions when IAM authentication is disabled/);
});

test('grant - enables IAM auth and grants specified actions to the grantee', () => {
Expand Down Expand Up @@ -618,7 +618,7 @@ describe('DatabaseCluster', () => {
});

// THEN
expect(() => { cluster.grant(role, 'neptune-db:ReadDataViaQuery', 'neptune-db:WriteDataViaQuery'); }).toThrow(/Cannot grant permissions as IAM authentication is disabled/);
expect(() => { cluster.grant(role, 'neptune-db:ReadDataViaQuery', 'neptune-db:WriteDataViaQuery'); }).toThrow(/Cannot grant permissions when IAM authentication is disabled/);
});

test('autoMinorVersionUpgrade is enabled when configured', () => {
Expand Down

0 comments on commit 3d369be

Please sign in to comment.