monorise 2.0.0-dev.6 → 2.0.0-dev.8
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/core/index.d.ts +1 -6
- package/dist/core/index.js +106 -153
- package/dist/core/index.js.map +1 -1
- package/dist/sst/components/analytics.d.ts +3 -1
- package/dist/sst/components/analytics.d.ts.map +1 -1
- package/dist/sst/components/monorise-core.d.ts +7 -0
- package/dist/sst/components/monorise-core.d.ts.map +1 -1
- package/dist/sst/components/q-function.d.ts.map +1 -1
- package/dist/sst/constants/event.d.ts +0 -7
- package/dist/sst/constants/event.d.ts.map +1 -1
- package/dist/sst/index.js +49 -27
- package/dist/sst/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -67,6 +67,8 @@ export declare class Analytics {
|
|
|
67
67
|
readonly queryApi?: sst.aws.ApiGatewayV2;
|
|
68
68
|
readonly processorFunctionName: string;
|
|
69
69
|
readonly backfillFunctionName: string;
|
|
70
|
-
constructor(id: string, args: AnalyticsArgs, table: sst.aws.Dynamo,
|
|
70
|
+
constructor(id: string, args: AnalyticsArgs, table: sst.aws.Dynamo,
|
|
71
|
+
/** Without it, no alarms are created. */
|
|
72
|
+
alarmTopic: sst.aws.SnsTopic | undefined, configRoot?: string, logging?: sst.aws.FunctionArgs['logging']);
|
|
71
73
|
}
|
|
72
74
|
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../components/analytics.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,4FAA4F;QAC5F,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;IACF,YAAY,CA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AAM,CAAC;KACvB,CAAC,CAAC;CACJ,CAAC;AAyFF,qBAAa,SAAS;IACpB,SAAgB,MAAM,EAAE;QAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAChF,SAAgB,YAAY,EAAE;QAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAC5D,SAAgB,SAAS,EAAE;QAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IACzD,SAAgB,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC;IACnE,SAAgB,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;IACnC,SAAgB,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;IACzC,SAAgB,QAAQ,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC;IAChD,SAAgB,qBAAqB,EAAE,MAAM,CAAC;IAC9C,SAAgB,oBAAoB,EAAE,MAAM,CAAC;gBAG3C,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM;IACrB,yCAAyC;IACzC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,SAAS,EACxC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC;CAiU5C"}
|
|
@@ -25,6 +25,13 @@ export type MonoriseCoreArgs = {
|
|
|
25
25
|
};
|
|
26
26
|
/** Disabled by default. Requires `.monorise/analytics-manifest.json`. */
|
|
27
27
|
analytics?: AnalyticsArgs;
|
|
28
|
+
/**
|
|
29
|
+
* CloudWatch alarms on the dead-letter queues, search reindex errors and
|
|
30
|
+
* analytics delivery, sent to `alarmTopic`. On by default. AWS bills each
|
|
31
|
+
* alarm, so stages that don't need them can turn them off:
|
|
32
|
+
* `alarms: $app.stage === 'production'`.
|
|
33
|
+
*/
|
|
34
|
+
alarms?: boolean;
|
|
28
35
|
webSocket?: WebSocketConfig;
|
|
29
36
|
};
|
|
30
37
|
export declare class MonoriseCore {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monorise-core.d.ts","sourceRoot":"","sources":["../../components/monorise-core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,sBAAsB,GAAG,WAAW,CACvC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,WAAW,CAAC,CAC/E,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,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{"version":3,"file":"q-function.d.ts","sourceRoot":"","sources":["../../components/q-function.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAChB,GAAG,MAAM,SAAS,GAClB,GAAG,MAAM,UAAU,GACnB,GAAG,MAAM,SAAS,GAClB,GAAG,MAAM,UAAU,CAAC;AAkBxB,UAAU,aAAc,SAAQ,GAAG,CAAC,GAAG,CAAC,YAAY;IAClD,iBAAiB,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAC3D,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC9B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;IACrC,SAAgB,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAmB;gBAEvB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;CAqE5C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Entity as EntityType } from '../../base/index';
|
|
2
2
|
declare const SOURCE: {
|
|
3
3
|
CORE: string;
|
|
4
|
-
GENERAL: string;
|
|
5
4
|
};
|
|
6
5
|
export type EventDetail = {
|
|
7
6
|
Source: string;
|
|
@@ -62,12 +61,6 @@ declare const EVENT: {
|
|
|
62
61
|
DetailType: string;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
GENERAL: {
|
|
66
|
-
ENDPOINT_ERROR: {
|
|
67
|
-
Source: string;
|
|
68
|
-
DetailType: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
64
|
};
|
|
72
65
|
export { SOURCE, EVENT };
|
|
73
66
|
//# sourceMappingURL=event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../constants/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D,QAAA,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../constants/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D,QAAA,MAAM,MAAM;;CAEX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA+CwB,UAAU,cAAc,UAAU;;;;uCAIlC,UAAU,cAAc,UAAU;;;;uCAIlC,UAAU,cAAc,UAAU;;;;;;;;;CASpE,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/sst/index.js
CHANGED
|
@@ -36,8 +36,7 @@ import path3 from "path";
|
|
|
36
36
|
|
|
37
37
|
// constants/event.ts
|
|
38
38
|
var SOURCE = {
|
|
39
|
-
CORE: "core-service"
|
|
40
|
-
GENERAL: "general"
|
|
39
|
+
CORE: "core-service"
|
|
41
40
|
};
|
|
42
41
|
var EVENT = {
|
|
43
42
|
CORE: {
|
|
@@ -99,12 +98,6 @@ var EVENT = {
|
|
|
99
98
|
Source: SOURCE.CORE,
|
|
100
99
|
DetailType: "prejoin-relationship-sync"
|
|
101
100
|
}
|
|
102
|
-
},
|
|
103
|
-
GENERAL: {
|
|
104
|
-
ENDPOINT_ERROR: {
|
|
105
|
-
Source: SOURCE.GENERAL,
|
|
106
|
-
DetailType: "endpoint-error"
|
|
107
|
-
}
|
|
108
101
|
}
|
|
109
102
|
};
|
|
110
103
|
|
|
@@ -498,8 +491,8 @@ var Analytics = class {
|
|
|
498
491
|
}, {
|
|
499
492
|
transform: { eventSourceMapping: { startingPosition: "LATEST", bisectBatchOnFunctionError: true, maximumRetryAttempts: 1, destinationConfig: { onFailure: { destinationArn: this.dlq.arn } } } }
|
|
500
493
|
});
|
|
501
|
-
new aws.cloudwatch.MetricAlarm(`${id}-analytics-dlq-alarm`, {
|
|
502
|
-
name: `${id}-analytics-dlq`,
|
|
494
|
+
if (alarmTopic) new aws.cloudwatch.MetricAlarm(`${id}-analytics-dlq-alarm`, {
|
|
495
|
+
name: `${$app.name}-${$app.stage}-${id}-analytics-dlq`,
|
|
503
496
|
namespace: "AWS/SQS",
|
|
504
497
|
metricName: "ApproximateNumberOfMessagesVisible",
|
|
505
498
|
statistic: "Maximum",
|
|
@@ -510,8 +503,8 @@ var Analytics = class {
|
|
|
510
503
|
alarmActions: [alarmTopic.arn],
|
|
511
504
|
dimensions: { QueueName: this.dlq.nodes.queue.name }
|
|
512
505
|
});
|
|
513
|
-
new aws.cloudwatch.MetricAlarm(`${id}-analytics-iterator-age`, {
|
|
514
|
-
name: `${id}-analytics-iterator-age`,
|
|
506
|
+
if (alarmTopic) new aws.cloudwatch.MetricAlarm(`${id}-analytics-iterator-age`, {
|
|
507
|
+
name: `${$app.name}-${$app.stage}-${id}-analytics-iterator-age`,
|
|
515
508
|
namespace: "AWS/Lambda",
|
|
516
509
|
metricName: "IteratorAge",
|
|
517
510
|
statistic: "Maximum",
|
|
@@ -522,8 +515,8 @@ var Analytics = class {
|
|
|
522
515
|
alarmActions: [alarmTopic.arn],
|
|
523
516
|
dimensions: { FunctionName: this.processorFunctionName }
|
|
524
517
|
});
|
|
525
|
-
new aws.cloudwatch.MetricAlarm(`${id}-analytics-firehose-failures`, {
|
|
526
|
-
name: `${id}-analytics-firehose-failures`,
|
|
518
|
+
if (alarmTopic) new aws.cloudwatch.MetricAlarm(`${id}-analytics-firehose-failures`, {
|
|
519
|
+
name: `${$app.name}-${$app.stage}-${id}-analytics-firehose-failures`,
|
|
527
520
|
namespace: "AWS/Firehose",
|
|
528
521
|
metricName: "DeliveryToS3.DataFreshness",
|
|
529
522
|
statistic: "Maximum",
|
|
@@ -602,8 +595,8 @@ var Analytics = class {
|
|
|
602
595
|
// current state when delivery is enabled again.
|
|
603
596
|
input: JSON.stringify({ action: "reconcile" })
|
|
604
597
|
}, { dependsOn: [backfillNotification] });
|
|
605
|
-
new aws.cloudwatch.MetricAlarm(`${id}-analytics-backfill-errors`, {
|
|
606
|
-
name: `${id}-analytics-backfill-errors`,
|
|
598
|
+
if (alarmTopic) new aws.cloudwatch.MetricAlarm(`${id}-analytics-backfill-errors`, {
|
|
599
|
+
name: `${$app.name}-${$app.stage}-${id}-analytics-backfill-errors`,
|
|
607
600
|
namespace: "AWS/Lambda",
|
|
608
601
|
metricName: "Errors",
|
|
609
602
|
statistic: "Sum",
|
|
@@ -744,7 +737,8 @@ var QFunction = class {
|
|
|
744
737
|
const dlqMessageAlarm = new aws.cloudwatch.MetricAlarm(
|
|
745
738
|
`${id}-dlq-message-alarm`,
|
|
746
739
|
{
|
|
747
|
-
|
|
740
|
+
// Named after its queue, so it sorts next to it.
|
|
741
|
+
name: dlqName ? `${dlqName}-alarm` : `${$app.name}-${$app.stage}-${id}-dlq-alarm`,
|
|
748
742
|
comparisonOperator: "GreaterThanOrEqualToThreshold",
|
|
749
743
|
evaluationPeriods: 1,
|
|
750
744
|
metricName: "ApproximateNumberOfMessagesVisible",
|
|
@@ -779,7 +773,7 @@ var SingleTable = class {
|
|
|
779
773
|
var _a;
|
|
780
774
|
this.id = id;
|
|
781
775
|
const namePrefix = `${$app.name}-${$app.stage}-${id}`;
|
|
782
|
-
this.replicatorFunctionName = `${namePrefix}-
|
|
776
|
+
this.replicatorFunctionName = `${namePrefix}-replicator`;
|
|
783
777
|
this.dlq = new sst.aws.Queue(`${id}-core-replicator-dlq`, {
|
|
784
778
|
transform: { queue: { name: `${namePrefix}-replicator-dlq` } }
|
|
785
779
|
});
|
|
@@ -902,7 +896,13 @@ var MonoriseCore = class {
|
|
|
902
896
|
}
|
|
903
897
|
});
|
|
904
898
|
this.id = id;
|
|
899
|
+
const namePrefix = `${$app.name}-${$app.stage}-${id}`;
|
|
905
900
|
this.api = new sst.aws.ApiGatewayV2(`${id}-monorise-api`, {
|
|
901
|
+
transform: {
|
|
902
|
+
api: { name: `${namePrefix}-api` },
|
|
903
|
+
// SST keeps an existing stage's log group, so this names new ones.
|
|
904
|
+
logGroup: { name: `/aws/vendedlogs/apis/${namePrefix}-api` }
|
|
905
|
+
},
|
|
906
906
|
cors: {
|
|
907
907
|
allowMethods: ["*"],
|
|
908
908
|
allowCredentials: true,
|
|
@@ -921,7 +921,9 @@ var MonoriseCore = class {
|
|
|
921
921
|
apiUrl: this.api.url
|
|
922
922
|
}
|
|
923
923
|
});
|
|
924
|
-
this.bus = new sst.aws.Bus(`${id}-monorise-bus
|
|
924
|
+
this.bus = new sst.aws.Bus(`${id}-monorise-bus`, {
|
|
925
|
+
transform: { bus: { name: `${namePrefix}-bus` } }
|
|
926
|
+
});
|
|
925
927
|
const analyticsEnabled = Boolean((args == null ? void 0 : args.analytics) && args.analytics.enabled !== false);
|
|
926
928
|
this.table = new SingleTable(id, {
|
|
927
929
|
runtime,
|
|
@@ -934,7 +936,6 @@ var MonoriseCore = class {
|
|
|
934
936
|
"API_KEYS",
|
|
935
937
|
'{"default": ["secret1", "secret2"]}'
|
|
936
938
|
);
|
|
937
|
-
const namePrefix = `${$app.name}-${$app.stage}-${id}`;
|
|
938
939
|
const appHandlerName = `${namePrefix}-app-handler`;
|
|
939
940
|
const appHandlerEnvironment = {
|
|
940
941
|
API_KEYS: secretApiKeys.value,
|
|
@@ -947,7 +948,16 @@ var MonoriseCore = class {
|
|
|
947
948
|
secretApiKeys,
|
|
948
949
|
...(_b = args == null ? void 0 : args.link) != null ? _b : []
|
|
949
950
|
];
|
|
950
|
-
|
|
951
|
+
const alarms = (args == null ? void 0 : args.alarms) !== false;
|
|
952
|
+
this.alarmTopic = new sst.aws.SnsTopic(`${id}-monorise-dlq-alarm-topic`, {
|
|
953
|
+
transform: {
|
|
954
|
+
topic: (topicArgs, opts) => {
|
|
955
|
+
var _a2;
|
|
956
|
+
topicArgs.name = `${namePrefix}-alarms`;
|
|
957
|
+
opts.ignoreChanges = [...(_a2 = opts.ignoreChanges) != null ? _a2 : [], "name"];
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
});
|
|
951
961
|
if (analyticsEnabled && (args == null ? void 0 : args.analytics)) {
|
|
952
962
|
if (args.fromTableName && ((_c = args.analytics.importedTable) == null ? void 0 : _c.pointInTimeRecoveryEnabled) !== true) {
|
|
953
963
|
throw new Error(
|
|
@@ -958,7 +968,7 @@ var MonoriseCore = class {
|
|
|
958
968
|
id,
|
|
959
969
|
args.analytics,
|
|
960
970
|
this.table.table,
|
|
961
|
-
this.alarmTopic,
|
|
971
|
+
alarms ? this.alarmTopic : void 0,
|
|
962
972
|
args.configRoot,
|
|
963
973
|
logging
|
|
964
974
|
);
|
|
@@ -978,7 +988,7 @@ var MonoriseCore = class {
|
|
|
978
988
|
memory: "512 MB",
|
|
979
989
|
timeout: "30 seconds",
|
|
980
990
|
visibilityTimeout: "30 seconds",
|
|
981
|
-
alarmTopic: this.alarmTopic,
|
|
991
|
+
alarmTopic: alarms ? this.alarmTopic : void 0,
|
|
982
992
|
runtime,
|
|
983
993
|
environment,
|
|
984
994
|
link: [this.table.table, this.bus],
|
|
@@ -992,7 +1002,7 @@ var MonoriseCore = class {
|
|
|
992
1002
|
memory: "512 MB",
|
|
993
1003
|
timeout: "30 seconds",
|
|
994
1004
|
visibilityTimeout: "30 seconds",
|
|
995
|
-
alarmTopic: this.alarmTopic,
|
|
1005
|
+
alarmTopic: alarms ? this.alarmTopic : void 0,
|
|
996
1006
|
runtime,
|
|
997
1007
|
environment,
|
|
998
1008
|
link: [this.table.table],
|
|
@@ -1006,13 +1016,14 @@ var MonoriseCore = class {
|
|
|
1006
1016
|
memory: "512 MB",
|
|
1007
1017
|
timeout: "30 seconds",
|
|
1008
1018
|
visibilityTimeout: "30 seconds",
|
|
1009
|
-
alarmTopic: this.alarmTopic,
|
|
1019
|
+
alarmTopic: alarms ? this.alarmTopic : void 0,
|
|
1010
1020
|
runtime,
|
|
1011
1021
|
environment,
|
|
1012
1022
|
link: [this.table.table],
|
|
1013
1023
|
logging
|
|
1014
1024
|
});
|
|
1015
1025
|
this.bus.subscribeQueue(`${id}-mutual-queue-rule`, mutualProcessor.queue, {
|
|
1026
|
+
transform: { rule: { name: `${namePrefix}-mutual-rule` } },
|
|
1016
1027
|
pattern: {
|
|
1017
1028
|
source: [SOURCE.CORE],
|
|
1018
1029
|
detailType: [
|
|
@@ -1022,6 +1033,7 @@ var MonoriseCore = class {
|
|
|
1022
1033
|
}
|
|
1023
1034
|
});
|
|
1024
1035
|
this.bus.subscribeQueue(`${id}-tag-queue-rule`, tagProcessor.queue, {
|
|
1036
|
+
transform: { rule: { name: `${namePrefix}-tag-rule` } },
|
|
1025
1037
|
pattern: {
|
|
1026
1038
|
source: [SOURCE.CORE],
|
|
1027
1039
|
detailType: [
|
|
@@ -1031,6 +1043,7 @@ var MonoriseCore = class {
|
|
|
1031
1043
|
}
|
|
1032
1044
|
});
|
|
1033
1045
|
this.bus.subscribeQueue(`${id}-tree-queue-rule`, treeProcessor.queue, {
|
|
1046
|
+
transform: { rule: { name: `${namePrefix}-tree-rule` } },
|
|
1034
1047
|
pattern: {
|
|
1035
1048
|
source: [SOURCE.CORE],
|
|
1036
1049
|
detailType: [
|
|
@@ -1063,7 +1076,7 @@ var MonoriseCore = class {
|
|
|
1063
1076
|
`${id}-search-reindex-retries`,
|
|
1064
1077
|
{ functionName: searchReindex.name, maximumRetryAttempts: 0 }
|
|
1065
1078
|
);
|
|
1066
|
-
new aws.cloudwatch.MetricAlarm(`${id}-search-reindex-errors`, {
|
|
1079
|
+
if (alarms) new aws.cloudwatch.MetricAlarm(`${id}-search-reindex-errors`, {
|
|
1067
1080
|
name: `${searchReindexName}-errors`,
|
|
1068
1081
|
namespace: "AWS/Lambda",
|
|
1069
1082
|
metricName: "Errors",
|
|
@@ -1091,12 +1104,19 @@ var MonoriseCore = class {
|
|
|
1091
1104
|
if ((_d = args == null ? void 0 : args.webSocket) == null ? void 0 : _d.enabled) {
|
|
1092
1105
|
const memory = (_f = (_e = args.webSocket.handler) == null ? void 0 : _e.memory) != null ? _f : "512 MB";
|
|
1093
1106
|
const timeout = (_h = (_g = args.webSocket.handler) == null ? void 0 : _g.timeout) != null ? _h : "30 seconds";
|
|
1094
|
-
this.websocket = new sst.aws.ApiGatewayWebSocket(`${id}-websocket`, {
|
|
1107
|
+
this.websocket = new sst.aws.ApiGatewayWebSocket(`${id}-websocket`, {
|
|
1108
|
+
transform: {
|
|
1109
|
+
api: { name: `${namePrefix}-websocket` },
|
|
1110
|
+
// SST keeps an existing stage's log group, so this names new ones.
|
|
1111
|
+
accessLog: { name: `/aws/vendedlogs/apis/${namePrefix}-websocket` }
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1095
1114
|
const wsEnvironment = {
|
|
1096
1115
|
CORE_TABLE: this.table.table.name,
|
|
1097
1116
|
WEBSOCKET_MANAGEMENT_ENDPOINT: this.websocket.managementEndpoint
|
|
1098
1117
|
};
|
|
1099
1118
|
const connectHandler = new sst.aws.Function(`${id}-ws-connect`, {
|
|
1119
|
+
name: `${namePrefix}-ws-connect`,
|
|
1100
1120
|
handler: `${dotMonorisePath}/handle.wsConnect`,
|
|
1101
1121
|
runtime,
|
|
1102
1122
|
memory,
|
|
@@ -1105,6 +1125,7 @@ var MonoriseCore = class {
|
|
|
1105
1125
|
link: [this.table.table, this.websocket]
|
|
1106
1126
|
});
|
|
1107
1127
|
const disconnectHandler = new sst.aws.Function(`${id}-ws-disconnect`, {
|
|
1128
|
+
name: `${namePrefix}-ws-disconnect`,
|
|
1108
1129
|
handler: `${dotMonorisePath}/handle.wsDisconnect`,
|
|
1109
1130
|
runtime,
|
|
1110
1131
|
memory,
|
|
@@ -1113,6 +1134,7 @@ var MonoriseCore = class {
|
|
|
1113
1134
|
link: [this.table.table]
|
|
1114
1135
|
});
|
|
1115
1136
|
const defaultHandler = new sst.aws.Function(`${id}-ws-default`, {
|
|
1137
|
+
name: `${namePrefix}-ws-default`,
|
|
1116
1138
|
handler: `${dotMonorisePath}/handle.wsDefault`,
|
|
1117
1139
|
runtime,
|
|
1118
1140
|
memory,
|