diff --git a/packages/@aws-cdk/aws-redshift-alpha/lib/private/database-query-provider/privileges.ts b/packages/@aws-cdk/aws-redshift-alpha/lib/private/database-query-provider/privileges.ts index f1533bb9cb326..6c6785331df01 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/lib/private/database-query-provider/privileges.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/lib/private/database-query-provider/privileges.ts @@ -1,9 +1,9 @@ /* eslint-disable-next-line import/no-unresolved */ import * as AWSLambda from 'aws-lambda'; +import { TablePrivilege, UserTablePrivilegesHandlerProps } from '../handler-props'; import { executeStatement } from './redshift-data'; import { ClusterProps } from './types'; import { makePhysicalId } from './util'; -import { TablePrivilege, UserTablePrivilegesHandlerProps } from '../handler-props'; export async function handler(props: UserTablePrivilegesHandlerProps & ClusterProps, event: AWSLambda.CloudFormationCustomResourceEvent) { const username = props.username; @@ -62,10 +62,26 @@ async function updatePrivileges( } const oldTablePrivileges = oldResourceProperties.tablePrivileges; - if (oldTablePrivileges !== tablePrivileges) { - await revokePrivileges(username, oldTablePrivileges, clusterProps); - await grantPrivileges(username, tablePrivileges, clusterProps); - return { replace: false }; + const tablesToRevoke = oldTablePrivileges.filter(({ tableId, actions }) => ( + tablePrivileges.find(({ tableId: otherTableId, actions: otherActions }) => ( + tableId === otherTableId && actions.some(action => !otherActions.includes(action)) + )) + )); + if (tablesToRevoke.length > 0) { + await revokePrivileges(username, tablesToRevoke, clusterProps); + } + + const tablesToGrant = tablePrivileges.filter(({ tableId, tableName, actions }) => { + const tableAdded = !oldTablePrivileges.find(({ tableId: otherTableId, tableName: otherTableName }) => ( + tableId === otherTableId && tableName === otherTableName + )); + const actionsAdded = oldTablePrivileges.find(({ tableId: otherTableId, actions: otherActions }) => ( + tableId === otherTableId && otherActions.some(action => !actions.includes(action)) + )); + return tableAdded || actionsAdded; + }); + if (tablesToGrant.length > 0) { + await grantPrivileges(username, tablesToGrant, clusterProps); } return { replace: false }; diff --git a/packages/@aws-cdk/aws-redshift-alpha/lib/private/handler-props.ts b/packages/@aws-cdk/aws-redshift-alpha/lib/private/handler-props.ts index b26fe2a5a7237..b0ac515d7e36a 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/lib/private/handler-props.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/lib/private/handler-props.ts @@ -25,6 +25,7 @@ export interface TableHandlerProps { } export interface TablePrivilege { + readonly tableId: string; readonly tableName: string; readonly actions: string[]; } diff --git a/packages/@aws-cdk/aws-redshift-alpha/lib/private/privileges.ts b/packages/@aws-cdk/aws-redshift-alpha/lib/private/privileges.ts index cb3f7367f8786..32b5c05fa224d 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/lib/private/privileges.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/lib/private/privileges.ts @@ -1,11 +1,11 @@ import * as cdk from 'aws-cdk-lib/core'; import { Construct } from 'constructs'; -import { DatabaseQuery } from './database-query'; -import { HandlerName } from './database-query-provider/handler-name'; -import { TablePrivilege as SerializedTablePrivilege, UserTablePrivilegesHandlerProps } from './handler-props'; import { DatabaseOptions } from '../database-options'; import { ITable, TableAction } from '../table'; import { IUser } from '../user'; +import { DatabaseQuery } from './database-query'; +import { HandlerName } from './database-query-provider/handler-name'; +import { TablePrivilege as SerializedTablePrivilege, UserTablePrivilegesHandlerProps } from './handler-props'; /** * The Redshift table and action that make up a privilege that can be granted to a Redshift user. @@ -63,23 +63,30 @@ export class UserTablePrivileges extends Construct { tablePrivileges: cdk.Lazy.any({ produce: () => { const reducedPrivileges = this.privileges.reduce((privileges, { table, actions }) => { - const tableName = table.tableName; - if (!(tableName in privileges)) { - privileges[tableName] = []; + const tableId = table.node.id; + if (!(tableId in privileges)) { + privileges[tableId] = { + tableName: table.tableName, + actions: [], + }; } - actions = actions.concat(privileges[tableName]); + actions = actions.concat(privileges[tableId].actions); if (actions.includes(TableAction.ALL)) { actions = [TableAction.ALL]; } if (actions.includes(TableAction.UPDATE) || actions.includes(TableAction.DELETE)) { actions.push(TableAction.SELECT); } - privileges[tableName] = Array.from(new Set(actions)); + privileges[tableId] = { + tableName: table.tableName, + actions: Array.from(new Set(actions)), + }; return privileges; - }, {} as { [key: string]: TableAction[] }); - const serializedPrivileges: SerializedTablePrivilege[] = Object.entries(reducedPrivileges).map(([tableName, actions]) => ({ - tableName: tableName, - actions: actions.map(action => TableAction[action]), + }, {} as { [key: string]: { tableName: string, actions: TableAction[] } }); + const serializedPrivileges: SerializedTablePrivilege[] = Object.entries(reducedPrivileges).map(([tableId, config]) => ({ + tableId, + tableName: config.tableName, + actions: config.actions.map(action => TableAction[action]), })); return serializedPrivileges; }, diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/database-query-provider/privileges.test.ts b/packages/@aws-cdk/aws-redshift-alpha/test/database-query-provider/privileges.test.ts index bad794b745355..5b91c38728f4b 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/database-query-provider/privileges.test.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/test/database-query-provider/privileges.test.ts @@ -3,7 +3,9 @@ import type * as AWSLambda from 'aws-lambda'; const username = 'username'; const tableName = 'tableName'; -const tablePrivileges = [{ tableName, actions: ['INSERT', 'SELECT'] }]; +const tableId = 'tableId'; +const actions = ['INSERT', 'SELECT']; +const tablePrivileges = [{ tableId, tableName, actions }]; const clusterName = 'clusterName'; const adminUserArn = 'adminUserArn'; const databaseName = 'databaseName'; @@ -147,9 +149,27 @@ describe('update', () => { })); }); - test('does not replace when privileges change', async () => { + test('does not replace when table name is changed', async () => { const newTableName = 'newTableName'; - const newTablePrivileges = [{ tableName: newTableName, actions: ['DROP'] }]; + const newTablePrivileges = [{ tableId, tableName: newTableName, actions }]; + const newResourceProperties = { + ...resourceProperties, + tablePrivileges: newTablePrivileges, + }; + + await expect(managePrivileges(newResourceProperties, event)).resolves.toMatchObject({ + PhysicalResourceId: physicalResourceId, + }); + expect(mockExecuteStatement).not.toHaveBeenCalledWith(expect.objectContaining({ + Sql: `REVOKE INSERT, SELECT ON ${newTableName} FROM ${username}`, + })); + expect(mockExecuteStatement).not.toHaveBeenCalledWith(expect.objectContaining({ + Sql: expect.stringMatching(new RegExp(`.+ ON ${tableName} TO ${username}`)), + })); + }); + + test('does not replace when table actions are changed', async () => { + const newTablePrivileges = [{ tableId, tableName, actions: ['DROP'] }]; const newResourceProperties = { ...resourceProperties, tablePrivileges: newTablePrivileges, @@ -162,7 +182,49 @@ describe('update', () => { Sql: `REVOKE INSERT, SELECT ON ${tableName} FROM ${username}`, })); expect(mockExecuteStatement).toHaveBeenCalledWith(expect.objectContaining({ - Sql: `GRANT DROP ON ${newTableName} TO ${username}`, + Sql: `GRANT DROP ON ${tableName} TO ${username}`, })); }); -}); + + test('does not replace when table id is changed', async () => { + const newTableId = 'newTableId'; + const newTablePrivileges = [{ tableId: newTableId, tableName, actions }]; + const newResourceProperties = { + ...resourceProperties, + tablePrivileges: newTablePrivileges, + }; + + await expect(managePrivileges(newResourceProperties, event)).resolves.toMatchObject({ + PhysicalResourceId: physicalResourceId, + }); + expect(mockExecuteStatement).not.toHaveBeenCalledWith(expect.objectContaining({ + Sql: expect.stringMatching(new RegExp(`REVOKE .+ ON ${tableName} FROM ${username}`)), + })); + expect(mockExecuteStatement).toHaveBeenCalledWith(expect.objectContaining({ + Sql: expect.stringMatching(new RegExp(`GRANT .+ ON ${tableName} TO ${username}`)), + })); + }); + + test('does not replace when table id is appended', async () => { + const newTablePrivileges = [{ tableId: 'newTableId', tableName, actions }]; + const newResourceProperties = { + ...resourceProperties, + tablePrivileges: newTablePrivileges, + }; + + const newEvent = { + ...event, + OldResourceProperties: { + ...event.OldResourceProperties, + tablePrivileges: [{ tableName, actions }], + }, + }; + + await expect(managePrivileges(newResourceProperties, newEvent)).resolves.toMatchObject({ + PhysicalResourceId: physicalResourceId, + }); + expect(mockExecuteStatement).not.toHaveBeenCalledWith(expect.objectContaining({ + Sql: expect.stringMatching(new RegExp(`.+ ON ${tableName} FROM ${username}`)), + })); + }); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/privileges.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/privileges.js deleted file mode 100644 index 933b0fa5ac57a..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/privileges.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = void 0; -const redshift_data_1 = require("./redshift-data"); -const util_1 = require("./util"); -async function handler(props, event) { - const username = props.username; - const tablePrivileges = props.tablePrivileges; - const clusterProps = props; - if (event.RequestType === 'Create') { - await grantPrivileges(username, tablePrivileges, clusterProps); - return { PhysicalResourceId: (0, util_1.makePhysicalId)(username, clusterProps, event.RequestId) }; - } - else if (event.RequestType === 'Delete') { - await revokePrivileges(username, tablePrivileges, clusterProps); - return; - } - else if (event.RequestType === 'Update') { - const { replace } = await updatePrivileges(username, tablePrivileges, clusterProps, event.OldResourceProperties); - const physicalId = replace ? (0, util_1.makePhysicalId)(username, clusterProps, event.RequestId) : event.PhysicalResourceId; - return { PhysicalResourceId: physicalId }; - } - else { - /* eslint-disable-next-line dot-notation */ - throw new Error(`Unrecognized event type: ${event['RequestType']}`); - } -} -exports.handler = handler; -async function revokePrivileges(username, tablePrivileges, clusterProps) { - await Promise.all(tablePrivileges.map(({ tableName, actions }) => { - return (0, redshift_data_1.executeStatement)(`REVOKE ${actions.join(', ')} ON ${tableName} FROM ${username}`, clusterProps); - })); -} -async function grantPrivileges(username, tablePrivileges, clusterProps) { - await Promise.all(tablePrivileges.map(({ tableName, actions }) => { - return (0, redshift_data_1.executeStatement)(`GRANT ${actions.join(', ')} ON ${tableName} TO ${username}`, clusterProps); - })); -} -async function updatePrivileges(username, tablePrivileges, clusterProps, oldResourceProperties) { - const oldClusterProps = oldResourceProperties; - if (clusterProps.clusterName !== oldClusterProps.clusterName || clusterProps.databaseName !== oldClusterProps.databaseName) { - await grantPrivileges(username, tablePrivileges, clusterProps); - return { replace: true }; - } - const oldUsername = oldResourceProperties.username; - if (oldUsername !== username) { - await grantPrivileges(username, tablePrivileges, clusterProps); - return { replace: true }; - } - const oldTablePrivileges = oldResourceProperties.tablePrivileges; - if (oldTablePrivileges !== tablePrivileges) { - await revokePrivileges(username, oldTablePrivileges, clusterProps); - await grantPrivileges(username, tablePrivileges, clusterProps); - return { replace: false }; - } - return { replace: false }; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmlsZWdlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInByaXZpbGVnZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsbURBQW1EO0FBRW5ELGlDQUF3QztBQUdqQyxLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQXFELEVBQUUsS0FBa0Q7SUFDckksTUFBTSxRQUFRLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQztJQUNoQyxNQUFNLGVBQWUsR0FBRyxLQUFLLENBQUMsZUFBZSxDQUFDO0lBQzlDLE1BQU0sWUFBWSxHQUFHLEtBQUssQ0FBQztJQUUzQixJQUFJLEtBQUssQ0FBQyxXQUFXLEtBQUssUUFBUSxFQUFFO1FBQ2xDLE1BQU0sZUFBZSxDQUFDLFFBQVEsRUFBRSxlQUFlLEVBQUUsWUFBWSxDQUFDLENBQUM7UUFDL0QsT0FBTyxFQUFFLGtCQUFrQixFQUFFLElBQUEscUJBQWMsRUFBQyxRQUFRLEVBQUUsWUFBWSxFQUFFLEtBQUssQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDO0tBQ3hGO1NBQU0sSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFL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VByaXZpbGVnZXMgIT09IHRhYmxlUHJpdmlsZWdlcykge1xuICAgIGF3YWl0IHJldm9rZVByaXZpbGVnZXModXNlcm5hbWUsIG9sZFRhYmxlUHJpdmlsZWdlcywgY2x1c3RlclByb3BzKTtcbiAgICBhd2FpdCBncmFudFByaXZpbGVnZXModXNlcm5hbWUsIHRhYmxlUHJpdmlsZWdlcywgY2x1c3RlclByb3BzKTtcbiAgICByZXR1cm4geyByZXBsYWNlOiBmYWxzZSB9O1xuICB9XG5cbiAgcmV0dXJuIHsgcmVwbGFjZTogZmFsc2UgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/types.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/types.js deleted file mode 100644 index 070bb11c1600e..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/types.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TableSortStyle = void 0; -/** - * The sort style of a table. - * This has been duplicated here to exporting private types. - */ -var TableSortStyle; -(function (TableSortStyle) { - /** - * Amazon Redshift assigns an optimal sort key based on the table data. - */ - TableSortStyle["AUTO"] = "AUTO"; - /** - * Specifies that the data is sorted using a compound key made up of all of the listed columns, - * in the order they are listed. - */ - TableSortStyle["COMPOUND"] = "COMPOUND"; - /** - * Specifies that the data is sorted using an interleaved sort key. - */ - TableSortStyle["INTERLEAVED"] = "INTERLEAVED"; -})(TableSortStyle = exports.TableSortStyle || (exports.TableSortStyle = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJ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ZXkgbWFkZSB1cCBvZiBhbGwgb2YgdGhlIGxpc3RlZCBjb2x1bW5zLFxuICAgKiBpbiB0aGUgb3JkZXIgdGhleSBhcmUgbGlzdGVkLlxuICAgKi9cbiAgQ09NUE9VTkQgPSAnQ09NUE9VTkQnLFxuXG4gIC8qKlxuICAgKiBTcGVjaWZpZXMgdGhhdCB0aGUgZGF0YSBpcyBzb3J0ZWQgdXNpbmcgYW4gaW50ZXJsZWF2ZWQgc29ydCBrZXkuXG4gICAqL1xuICBJTlRFUkxFQVZFRCA9ICdJTlRFUkxFQVZFRCcsXG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/handler-name.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/handler-name.js similarity index 66% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/handler-name.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/handler-name.js index 4983115a93834..a8e809f76444f 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/handler-name.js +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/handler-name.js @@ -6,5 +6,5 @@ var HandlerName; HandlerName["User"] = "user"; HandlerName["Table"] = "table"; HandlerName["UserTablePrivileges"] = "user-table-privileges"; -})(HandlerName = exports.HandlerName || (exports.HandlerName = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlci1uYW1lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaGFuZGxlci1uYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLElBQVksV0FJWDtBQUpELFdBQVksV0FBVztJQUNyQiw0QkFBYSxDQUFBO0lBQ2IsOEJBQWUsQ0FBQTtJQUNmLDREQUE2QyxDQUFBO0FBQy9DLENBQUMsRUFKVyxXQUFXLEdBQVgsbUJBQVcsS0FBWCxtQkFBVyxRQUl0QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIEhhbmRsZXJOYW1lIHtcbiAgVXNlciA9ICd1c2VyJyxcbiAgVGFibGUgPSAndGFibGUnLFxuICBVc2VyVGFibGVQcml2aWxlZ2VzID0gJ3VzZXItdGFibGUtcHJpdmlsZWdlcycsXG59XG4iXX0= \ No newline at end of file +})(HandlerName || (exports.HandlerName = HandlerName = {})); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlci1uYW1lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaGFuZGxlci1uYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLElBQVksV0FJWDtBQUpELFdBQVksV0FBVztJQUNyQiw0QkFBYSxDQUFBO0lBQ2IsOEJBQWUsQ0FBQTtJQUNmLDREQUE2QyxDQUFBO0FBQy9DLENBQUMsRUFKVyxXQUFXLDJCQUFYLFdBQVcsUUFJdEIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBIYW5kbGVyTmFtZSB7XG4gIFVzZXIgPSAndXNlcicsXG4gIFRhYmxlID0gJ3RhYmxlJyxcbiAgVXNlclRhYmxlUHJpdmlsZWdlcyA9ICd1c2VyLXRhYmxlLXByaXZpbGVnZXMnLFxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/index.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/index.js similarity index 100% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/index.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/index.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/privileges.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/privileges.js new file mode 100644 index 0000000000000..22d622acfbd79 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/privileges.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = void 0; +const redshift_data_1 = require("./redshift-data"); +const util_1 = require("./util"); +async function handler(props, event) { + const username = props.username; + const tablePrivileges = props.tablePrivileges; + const clusterProps = props; + if (event.RequestType === 'Create') { + await grantPrivileges(username, tablePrivileges, clusterProps); + return { PhysicalResourceId: (0, util_1.makePhysicalId)(username, clusterProps, event.RequestId) }; + } + else if (event.RequestType === 'Delete') { + await revokePrivileges(username, tablePrivileges, clusterProps); + return; + } + else if (event.RequestType === 'Update') { + const { replace } = await updatePrivileges(username, tablePrivileges, clusterProps, event.OldResourceProperties); + const physicalId = replace ? (0, util_1.makePhysicalId)(username, clusterProps, event.RequestId) : event.PhysicalResourceId; + return { PhysicalResourceId: physicalId }; + } + else { + /* eslint-disable-next-line dot-notation */ + throw new Error(`Unrecognized event type: ${event['RequestType']}`); + } +} +exports.handler = handler; +async function revokePrivileges(username, tablePrivileges, clusterProps) { + await Promise.all(tablePrivileges.map(({ tableName, actions }) => { + return (0, redshift_data_1.executeStatement)(`REVOKE ${actions.join(', ')} ON ${tableName} FROM ${username}`, clusterProps); + })); +} +async function grantPrivileges(username, tablePrivileges, clusterProps) { + await Promise.all(tablePrivileges.map(({ tableName, actions }) => { + return (0, redshift_data_1.executeStatement)(`GRANT ${actions.join(', ')} ON ${tableName} TO ${username}`, clusterProps); + })); +} +async function updatePrivileges(username, tablePrivileges, clusterProps, oldResourceProperties) { + const oldClusterProps = oldResourceProperties; + if (clusterProps.clusterName !== oldClusterProps.clusterName || clusterProps.databaseName !== oldClusterProps.databaseName) { + await grantPrivileges(username, tablePrivileges, clusterProps); + return { replace: true }; + } + const oldUsername = oldResourceProperties.username; + if (oldUsername !== username) { + await grantPrivileges(username, tablePrivileges, clusterProps); + return { replace: true }; + } + const oldTablePrivileges = oldResourceProperties.tablePrivileges; + const tablesToRevoke = oldTablePrivileges.filter(({ tableId, actions }) => { + const tableRemoved = !tablePrivileges.find(({ tableId: otherTableId }) => tableId === otherTableId); + const actionsRemoved = tablePrivileges.find(({ tableId: otherTableId, actions: otherActions }) => (tableId === otherTableId && actions.some(action => !otherActions.includes(action)))); + return tableRemoved || actionsRemoved; + }); + if (tablesToRevoke.length > 0) { + await revokePrivileges(username, tablesToRevoke, clusterProps); + } + const tablesToGrant = tablePrivileges.filter(({ tableId, tableName, actions }) => { + const tableAdded = !oldTablePrivileges.find(({ tableId: otherTableId, tableName: otherTableName }) => (tableId === otherTableId && tableName === otherTableName)); + const actionsAdded = oldTablePrivileges.find(({ tableId: otherTableId, actions: otherActions }) => (tableId === otherTableId && otherActions.some(action => !actions.includes(action)))); + return tableAdded || actionsAdded; + }); + if (tablesToGrant.length > 0) { + await grantPrivileges(username, tablesToGrant, clusterProps); + } + return { replace: false }; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmlsZWdlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInByaXZpbGVnZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsbURBQW1EO0FBRW5ELGlDQUF3QztBQUdqQyxLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQXFELEVBQUUsS0FBa0Q7SUFDckksTUFBTSxRQUFRLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQztJQUNoQyxNQUFNLGVBQWUsR0FBRyxLQUFLLENBQUMsZUFBZSxDQUFDO0lBQzlDLE1BQU0sWUFBWSxHQUFHLEtBQUssQ0FBQztJQUUzQixJQUFJLEtBQUssQ0FBQyxXQUFXLEtBQUssUUFBUSxFQUFFO1FBQ2xDLE1BQU0sZUFBZSxDQUFDLFFBQVEsRUFBRSxlQUFlLEVBQUUsWUFBWSxDQUFDLENBQUM7UUFDL0QsT0FBTyxFQUFFLGtCQUFrQixFQUFFLElBQUEscUJBQWMsRUFBQyxRQUFRLEVBQUUsWUFBWSxFQUFFLEtBQUssQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDO0tBQ3hGO1NBQU0sSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUN6QyxNQUFNLGdCQUFnQixDQUFDLFFBQVEsRUFBRSxlQUFlLEVBQUUsWUFBWSxDQUFDLENBQUM7UUFDaEUsT0FBTztLQUNSO1NBQU0sSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUN6QyxNQUFNLEVBQUUsT0FBTyxFQUFFLEdBQUcsTUFBTSxnQkFBZ0IsQ0FDeEMsUUFBUSxFQUNSLGVBQWUsRUFDZixZ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KFxuICAgICAgdGFibGVJZCA9PT0gb3RoZXJUYWJsZUlkICYmIHRhYmxlTmFtZSA9PT0gb3RoZXJUYWJsZU5hbWVcbiAgICApKTtcbiAgICBjb25zdCBhY3Rpb25zQWRkZWQgPSBvbGRUYWJsZVByaXZpbGVnZXMuZmluZCgoeyB0YWJsZUlkOiBvdGhlclRhYmxlSWQsIGFjdGlvbnM6IG90aGVyQWN0aW9ucyB9KSA9PiAoXG4gICAgICB0YWJsZUlkID09PSBvdGhlclRhYmxlSWQgJiYgb3RoZXJBY3Rpb25zLnNvbWUoYWN0aW9uID0+ICFhY3Rpb25zLmluY2x1ZGVzKGFjdGlvbikpXG4gICAgKSk7XG4gICAgcmV0dXJuIHRhYmxlQWRkZWQgfHwgYWN0aW9uc0FkZGVkO1xuICB9KTtcbiAgaWYgKHRhYmxlc1RvR3JhbnQubGVuZ3RoID4gMCkge1xuICAgIGF3YWl0IGdyYW50UHJpdmlsZWdlcyh1c2VybmFtZSwgdGFibGVzVG9HcmFudCwgY2x1c3RlclByb3BzKTtcbiAgfVxuXG4gIHJldHVybiB7IHJlcGxhY2U6IGZhbHNlIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/redshift-data.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/redshift-data.js similarity index 100% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/redshift-data.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/redshift-data.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/table.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/table.js similarity index 100% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/table.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/table.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/types.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/types.js new file mode 100644 index 0000000000000..bbb29ad542beb --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/types.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TableSortStyle = void 0; +/** + * The sort style of a table. + * This has been duplicated here to exporting private types. + */ +var TableSortStyle; +(function (TableSortStyle) { + /** + * Amazon Redshift assigns an optimal sort key based on the table data. + */ + TableSortStyle["AUTO"] = "AUTO"; + /** + * Specifies that the data is sorted using a compound key made up of all of the listed columns, + * in the order they are listed. + */ + TableSortStyle["COMPOUND"] = "COMPOUND"; + /** + * Specifies that the data is sorted using an interleaved sort key. + */ + TableSortStyle["INTERLEAVED"] = "INTERLEAVED"; +})(TableSortStyle || (exports.TableSortStyle = TableSortStyle = {})); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid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gdXAgb2YgYWxsIG9mIHRoZSBsaXN0ZWQgY29sdW1ucyxcbiAgICogaW4gdGhlIG9yZGVyIHRoZXkgYXJlIGxpc3RlZC5cbiAgICovXG4gIENPTVBPVU5EID0gJ0NPTVBPVU5EJyxcblxuICAvKipcbiAgICogU3BlY2lmaWVzIHRoYXQgdGhlIGRhdGEgaXMgc29ydGVkIHVzaW5nIGFuIGludGVybGVhdmVkIHNvcnQga2V5LlxuICAgKi9cbiAgSU5URVJMRUFWRUQgPSAnSU5URVJMRUFWRUQnLFxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/user.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/user.js similarity index 100% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/user.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/user.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/util.js b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/util.js similarity index 100% rename from packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12/util.js rename to packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322/util.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.assets.json index 7ec384cc17f6a..d5a82d3341b39 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.assets.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.assets.json @@ -1,15 +1,15 @@ { - "version": "32.0.0", + "version": "33.0.0", "files": { - "135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12": { + "9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322": { "source": { - "path": "asset.135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12", + "path": "asset.9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12.zip", + "objectKey": "9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -27,7 +27,7 @@ } } }, - "e649af73551b4319a2a0e21caf62d7713f1cc03dcdcdfcd30a166662ac296044": { + "6fae0ba8b4b765af354f41f73909322034258496718c660bad8e5336344a6d56": { "source": { "path": "aws-cdk-redshift-cluster-database.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e649af73551b4319a2a0e21caf62d7713f1cc03dcdcdfcd30a166662ac296044.json", + "objectKey": "6fae0ba8b4b765af354f41f73909322034258496718c660bad8e5336344a6d56.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.template.json index a851f52c8dbd8..bc775401b82bd 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.template.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/aws-cdk-redshift-cluster-database.template.json @@ -909,6 +909,7 @@ }, "tablePrivileges": [ { + "tableId": "Table", "tableName": { "Ref": "Table7ABB320E" }, @@ -1004,7 +1005,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12.zip" + "S3Key": "9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/integ.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/integ.json index ce11f63584021..d49d391c62762 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "testCases": { "redshift-cluster-database-integ/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/manifest.json index 025be3904e4e9..a5c900cb614dc 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "artifacts": { "aws-cdk-redshift-cluster-database.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e649af73551b4319a2a0e21caf62d7713f1cc03dcdcdfcd30a166662ac296044.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6fae0ba8b4b765af354f41f73909322034258496718c660bad8e5336344a6d56.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/redshiftclusterdatabaseintegDefaultTestDeployAssert4339FB48.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/redshiftclusterdatabaseintegDefaultTestDeployAssert4339FB48.assets.json index 9104ab5ff793a..d39b55454659f 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/redshiftclusterdatabaseintegDefaultTestDeployAssert4339FB48.assets.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/redshiftclusterdatabaseintegDefaultTestDeployAssert4339FB48.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/tree.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/tree.json index d940bcbe5840a..e16c7fc3f7f65 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.database.js.snapshot/tree.json @@ -1228,7 +1228,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "TablePrivileges": { @@ -1470,13 +1470,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, @@ -1639,7 +1639,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "135d36da5a9e712a2792be4734f4cf4b34b551d49646eef9dec0c185fc869c12.zip" + "s3Key": "9b854795d4a2f1dea5d1c14d6cfcee1621c5d70dd8dfed2613d6e55c19022322.zip" }, "handler": "index.handler", "role": { @@ -1902,7 +1902,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, @@ -1946,7 +1946,7 @@ "path": "redshift-cluster-database-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -1992,7 +1992,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } },