@certenza/aws-cdk-infrastructure-commons 2.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/dynamodb.d.ts +8 -1
- package/dist/src/dynamodb.js +15 -1
- package/package.json +1 -1
package/dist/src/dynamodb.d.ts
CHANGED
|
@@ -29,5 +29,12 @@ type DynamoDBIndex = {
|
|
|
29
29
|
* @returns The DynamoDB table
|
|
30
30
|
*/
|
|
31
31
|
declare const createDynamoDBTable: (scope: Construct, tableName: string, keys: DynamoDBKeys, indexes: DynamoDBIndex[], options?: Partial<dynamodb.TableProps>) => cdk.aws_dynamodb.Table;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Import a DynamoDB table from the infrastructure dynamodb stack
|
|
34
|
+
* @param scope - The scope of the stack
|
|
35
|
+
* @param tableName - The name of the table to import
|
|
36
|
+
* @returns The imported DynamoDB table
|
|
37
|
+
*/
|
|
38
|
+
declare const importDynamoDBTable: (scope: Construct, tableName: string) => cdk.aws_dynamodb.ITable;
|
|
39
|
+
export { createDynamoDBTable, importDynamoDBTable };
|
|
33
40
|
export type { DynamoDBIndex, DynamoDBKeys };
|
package/dist/src/dynamodb.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createDynamoDBTable = void 0;
|
|
36
|
+
exports.importDynamoDBTable = exports.createDynamoDBTable = void 0;
|
|
37
37
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
38
38
|
const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
|
|
39
39
|
/**
|
|
@@ -97,3 +97,17 @@ const createDynamoDBTable = (scope, tableName, keys, indexes, options = {}) => {
|
|
|
97
97
|
return table;
|
|
98
98
|
};
|
|
99
99
|
exports.createDynamoDBTable = createDynamoDBTable;
|
|
100
|
+
/**
|
|
101
|
+
* Import a DynamoDB table from the infrastructure dynamodb stack
|
|
102
|
+
* @param scope - The scope of the stack
|
|
103
|
+
* @param tableName - The name of the table to import
|
|
104
|
+
* @returns The imported DynamoDB table
|
|
105
|
+
*/
|
|
106
|
+
const importDynamoDBTable = (scope, tableName) => {
|
|
107
|
+
return cdk.aws_dynamodb.Table.fromTableAttributes(scope, `Imported${tableName}Table`, {
|
|
108
|
+
tableName: cdk.Fn.importValue(`CertenzaInfrastructureDynamoDBStack-${tableName}TableName`),
|
|
109
|
+
tableArn: cdk.Fn.importValue(`CertenzaInfrastructureDynamoDBStack-${tableName}TableArn`),
|
|
110
|
+
tableStreamArn: cdk.Fn.importValue(`CertenzaInfrastructureDynamoDBStack-${tableName}TableStreamArn`),
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
exports.importDynamoDBTable = importDynamoDBTable;
|
package/package.json
CHANGED