@mettlecast/domain-cdk-packer 0.2.48 → 0.2.50
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/DomainStack.js +5 -5
- package/package.json +1 -1
package/dist/DomainStack.js
CHANGED
|
@@ -24,7 +24,7 @@ import { CanaryConstruct } from './constructs/canary-construct.js';
|
|
|
24
24
|
*/
|
|
25
25
|
/** L1 helper: adds a CfnRoute + CfnIntegration to an existing HTTP API. */
|
|
26
26
|
function addRouteToApi(scope, fn, path, methods, apiId) {
|
|
27
|
-
const id = path.replace(/[^a-zA-Z0-9]/g, '_').replace(/^_/, 'api');
|
|
27
|
+
const id = path.replace(/[^a-zA-Z0-9]/g, '_').replace(/^_/, 'api') + '_' + methods[0].toLowerCase();
|
|
28
28
|
const integ = new apigwv2.CfnIntegration(scope, 'Integ_' + id, {
|
|
29
29
|
apiId,
|
|
30
30
|
integrationType: 'AWS_PROXY',
|
|
@@ -199,7 +199,7 @@ export class DomainStack extends cdk.Stack {
|
|
|
199
199
|
else {
|
|
200
200
|
apiRoute = apiRouteBase;
|
|
201
201
|
}
|
|
202
|
-
addRouteToApi(this, fn, api.path
|
|
202
|
+
addRouteToApi(this, fn, `/${domainId}${api.path}`, [toHttpMethod(api.method)], this.httpApi.httpApiId);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
// Deploy webhooks as grouped Lambdas
|
|
@@ -242,7 +242,7 @@ export class DomainStack extends cdk.Stack {
|
|
|
242
242
|
// Add routes for each webhook entry
|
|
243
243
|
for (const webhook of registry.webhooks) {
|
|
244
244
|
const fn = webhookLambdas[0]; // Grouped Lambda or first dedicated
|
|
245
|
-
addRouteToApi(this, fn, webhook.path
|
|
245
|
+
addRouteToApi(this, fn, `/${domainId}${webhook.path}`, [apigwv2.HttpMethod.POST], this.httpApi.httpApiId);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
// Deploy event subscribers as grouped Lambdas
|
|
@@ -507,8 +507,8 @@ export class DomainStack extends cdk.Stack {
|
|
|
507
507
|
DB_SECRET_ARN: dbSecretArn ?? '',
|
|
508
508
|
},
|
|
509
509
|
});
|
|
510
|
-
addRouteToApi(this, healthConstruct.healthFn,
|
|
511
|
-
addRouteToApi(this, healthConstruct.readyFn,
|
|
510
|
+
addRouteToApi(this, healthConstruct.healthFn, `/${domainId}/_health`, [apigwv2.HttpMethod.GET], this.httpApi.httpApiId);
|
|
511
|
+
addRouteToApi(this, healthConstruct.readyFn, `/${domainId}/_ready`, [apigwv2.HttpMethod.GET], this.httpApi.httpApiId);
|
|
512
512
|
// Create CloudWatch dashboard for all primitives
|
|
513
513
|
const allEndpoints = [
|
|
514
514
|
...registry.apis.map(a => ({ id: a.id, primitiveClass: 'api' })),
|