@certenza/aws-cdk-infrastructure-commons 2.0.4 → 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.
@@ -86,10 +86,6 @@ const createApiGateway = (scope, apiName, domainName, hostedZoneId, zoneName) =>
86
86
  })),
87
87
  },
88
88
  });
89
- // Add a dependency on the API root to help ensure deployments update
90
- if (api.deploymentStage) {
91
- api.deploymentStage.node.addDependency(api.root);
92
- }
93
89
  // Create Route53 A record pointing to the API Gateway
94
90
  new route53.ARecord(scope, `${apiName}-AliasRecord`, {
95
91
  zone: hostedZone,
@@ -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
- export { createDynamoDBTable };
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 };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certenza/aws-cdk-infrastructure-commons",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Common infrastructure reusable utilities and resources for Certenza projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",