@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
18 lines (17 loc) • 883 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.pluginRuntimeEnv = pluginRuntimeEnv;
exports.grantPluginRuntimeRead = grantPluginRuntimeRead;
/** Env for any Lambda that READS the plugin catalog. The catalog implies the accounts catalog (binding
* availability — pluginAccess.registeredAccounts throws without it), so the two always travel together. */
function pluginRuntimeEnv(tables, discoveryRefreshSeconds) {
return {
PLUGIN_CATALOG_TABLE_NAME: tables.catalogTable.tableName,
ACCOUNTS_TABLE_NAME: tables.accountsTable.tableName,
...(discoveryRefreshSeconds === undefined ? {} : { PLUGIN_DISCOVERY_REFRESH_SECONDS: String(discoveryRefreshSeconds) }),
};
}
function grantPluginRuntimeRead(grantee, tables) {
tables.catalogTable.grantReadData(grantee);
tables.accountsTable.grantReadData(grantee);
}