@ts-cloud/core 0.2.3 → 0.2.4
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/advanced-features.test.d.ts +1 -0
- package/dist/aws/cloudformation.d.ts +136 -0
- package/dist/aws/cloudfront.d.ts +45 -0
- package/dist/aws/credentials.d.ts +77 -0
- package/dist/aws/credentials.test.d.ts +4 -0
- package/dist/aws/index.d.ts +10 -0
- package/dist/aws/s3.d.ts +256 -0
- package/dist/aws/s3.test.d.ts +4 -0
- package/dist/aws/signature.d.ts +142 -0
- package/dist/aws/signature.test.d.ts +4 -0
- package/dist/backup/disaster-recovery.d.ts +140 -0
- package/dist/backup/disaster-recovery.test.d.ts +1 -0
- package/dist/backup/index.d.ts +8 -0
- package/dist/backup/manager.d.ts +172 -0
- package/dist/backup/manager.test.d.ts +1 -0
- package/dist/cicd/circleci.d.ts +50 -0
- package/dist/cicd/github-actions.d.ts +62 -0
- package/dist/cicd/gitlab-ci.d.ts +50 -0
- package/dist/cicd/index.d.ts +7 -0
- package/dist/cli/history.d.ts +137 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/progress.d.ts +193 -0
- package/dist/cli/repl.d.ts +148 -0
- package/dist/cli/suggestions.d.ts +74 -0
- package/dist/cli/table.d.ts +73 -0
- package/dist/cli/table.test.d.ts +1 -0
- package/dist/cloudformation/builder.d.ts +93 -0
- package/dist/cloudformation/builder.test.d.ts +4 -0
- package/dist/cloudformation/builders/api-gateway.d.ts +30 -0
- package/dist/cloudformation/builders/cache.d.ts +35 -0
- package/dist/cloudformation/builders/cdn.d.ts +34 -0
- package/dist/cloudformation/builders/compute.d.ts +68 -0
- package/dist/cloudformation/builders/database.d.ts +61 -0
- package/dist/cloudformation/builders/functions.d.ts +32 -0
- package/dist/cloudformation/builders/messaging.d.ts +17 -0
- package/dist/cloudformation/builders/monitoring.d.ts +39 -0
- package/dist/cloudformation/builders/network.d.ts +14 -0
- package/dist/cloudformation/builders/queue.d.ts +16 -0
- package/dist/cloudformation/builders/security.d.ts +31 -0
- package/dist/cloudformation/builders/storage.d.ts +36 -0
- package/dist/cloudformation/index.d.ts +10 -0
- package/dist/cloudformation/types.d.ts +200 -0
- package/dist/compliance/aws-config.d.ts +175 -0
- package/dist/compliance/cloudtrail.d.ts +132 -0
- package/dist/compliance/compliance.test.d.ts +1 -0
- package/dist/compliance/guardduty.d.ts +176 -0
- package/dist/compliance/index.d.ts +12 -0
- package/dist/compliance/security-hub.d.ts +178 -0
- package/dist/containers/build-optimization.d.ts +155 -0
- package/dist/containers/containers.test.d.ts +1 -0
- package/dist/containers/image-scanning.d.ts +144 -0
- package/dist/containers/index.d.ts +8 -0
- package/dist/containers/registry.d.ts +129 -0
- package/dist/containers/service-mesh.d.ts +254 -0
- package/dist/database/database.test.d.ts +1 -0
- package/dist/database/index.d.ts +8 -0
- package/dist/database/migrations.d.ts +153 -0
- package/dist/database/performance.d.ts +219 -0
- package/dist/database/replicas.d.ts +218 -0
- package/dist/database/users.d.ts +165 -0
- package/dist/dependency-graph.d.ts +37 -0
- package/dist/deployment/ab-testing.d.ts +165 -0
- package/dist/deployment/blue-green.d.ts +140 -0
- package/dist/deployment/canary.d.ts +165 -0
- package/dist/deployment/deployment.test.d.ts +1 -0
- package/dist/deployment/index.d.ts +12 -0
- package/dist/deployment/progressive.d.ts +50 -0
- package/dist/dns/dns.test.d.ts +1 -0
- package/dist/dns/dnssec.d.ts +120 -0
- package/dist/dns/index.d.ts +7 -0
- package/dist/dns/resolver.d.ts +216 -0
- package/dist/dns/routing.d.ts +277 -0
- package/dist/email/advanced/analytics.d.ts +107 -0
- package/dist/email/advanced/index.d.ts +10 -0
- package/dist/email/advanced/rules.d.ts +131 -0
- package/dist/email/advanced/scheduling.d.ts +81 -0
- package/dist/email/advanced/search.d.ts +91 -0
- package/dist/email/advanced/shared-mailboxes.d.ts +109 -0
- package/dist/email/advanced/templates.d.ts +95 -0
- package/dist/email/advanced/threading.d.ts +65 -0
- package/dist/email/analytics.d.ts +189 -0
- package/dist/email/bounce-handling.d.ts +171 -0
- package/dist/email/email.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/inbound.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/outbound.test.d.ts +1 -0
- package/dist/email/handlers/converter.d.ts +11 -0
- package/dist/email/handlers/feedback.d.ts +11 -0
- package/dist/email/handlers/inbound.d.ts +13 -0
- package/dist/email/handlers/outbound.d.ts +13 -0
- package/dist/email/index.d.ts +10 -0
- package/dist/email/reputation.d.ts +133 -0
- package/dist/email/templates.d.ts +124 -0
- package/dist/errors/index.d.ts +177 -0
- package/dist/errors/index.test.d.ts +4 -0
- package/dist/health-checks/index.d.ts +35 -0
- package/dist/index.d.ts +15 -256
- package/dist/index.js +228 -80
- package/dist/intrinsic-functions.d.ts +77 -0
- package/dist/lambda/concurrency.d.ts +146 -0
- package/dist/lambda/destinations.d.ts +141 -0
- package/dist/lambda/dlq.d.ts +160 -0
- package/dist/lambda/index.d.ts +10 -0
- package/dist/lambda/lambda.test.d.ts +1 -0
- package/dist/lambda/layers.d.ts +117 -0
- package/dist/lambda/versions.d.ts +145 -0
- package/dist/lambda/vpc.d.ts +164 -0
- package/dist/local/config.d.ts +44 -0
- package/dist/local/index.d.ts +5 -0
- package/dist/local/mock-aws.d.ts +69 -0
- package/dist/modules/ai.d.ts +108 -0
- package/dist/modules/api.d.ts +157 -0
- package/dist/modules/auth.d.ts +262 -0
- package/dist/modules/cache.d.ts +108 -0
- package/dist/modules/cdn.d.ts +305 -0
- package/dist/modules/communication.d.ts +117 -0
- package/dist/modules/compute.d.ts +1376 -0
- package/dist/modules/database.d.ts +144 -0
- package/dist/modules/deployment.d.ts +372 -0
- package/dist/modules/dns.d.ts +143 -0
- package/dist/modules/email.d.ts +314 -0
- package/dist/modules/filesystem.d.ts +132 -0
- package/dist/modules/index.d.ts +31 -0
- package/dist/modules/messaging.d.ts +210 -0
- package/dist/modules/monitoring.d.ts +574 -0
- package/dist/modules/network.d.ts +148 -0
- package/dist/modules/parameter-store.d.ts +143 -0
- package/dist/modules/permissions.d.ts +245 -0
- package/dist/modules/phone.d.ts +125 -0
- package/dist/modules/queue.d.ts +411 -0
- package/dist/modules/redirects.d.ts +140 -0
- package/dist/modules/registry.d.ts +189 -0
- package/dist/modules/search.d.ts +135 -0
- package/dist/modules/secrets.d.ts +149 -0
- package/dist/modules/security.d.ts +219 -0
- package/dist/modules/sms.d.ts +130 -0
- package/dist/modules/storage.d.ts +344 -0
- package/dist/modules/workflow.d.ts +288 -0
- package/dist/multi-account/config.d.ts +166 -0
- package/dist/multi-account/index.d.ts +6 -0
- package/dist/multi-account/manager.d.ts +181 -0
- package/dist/multi-region/cross-region.d.ts +204 -0
- package/dist/multi-region/index.d.ts +7 -0
- package/dist/multi-region/manager.d.ts +136 -0
- package/dist/multi-region/regions.d.ts +98 -0
- package/dist/network-security/index.d.ts +55 -0
- package/dist/observability/index.d.ts +8 -0
- package/dist/observability/logs.d.ts +213 -0
- package/dist/observability/metrics.d.ts +187 -0
- package/dist/observability/observability.test.d.ts +1 -0
- package/dist/observability/synthetics.d.ts +189 -0
- package/dist/observability/xray.d.ts +193 -0
- package/dist/phone/advanced/analytics.d.ts +83 -0
- package/dist/phone/advanced/callbacks.d.ts +67 -0
- package/dist/phone/advanced/index.d.ts +7 -0
- package/dist/phone/advanced/ivr-builder.d.ts +130 -0
- package/dist/phone/advanced/recording.d.ts +62 -0
- package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +1 -0
- package/dist/phone/handlers/incoming-call.d.ts +10 -0
- package/dist/phone/handlers/missed-call.d.ts +9 -0
- package/dist/phone/handlers/voicemail.d.ts +10 -0
- package/dist/phone/index.d.ts +5 -0
- package/dist/presets/api-backend.d.ts +11 -0
- package/dist/presets/data-pipeline.d.ts +11 -0
- package/dist/presets/extend.d.ts +194 -0
- package/dist/presets/extend.test.d.ts +4 -0
- package/dist/presets/fullstack-app.d.ts +12 -0
- package/dist/presets/index.d.ts +13 -0
- package/dist/presets/jamstack.d.ts +12 -0
- package/dist/presets/microservices.d.ts +18 -0
- package/dist/presets/ml-api.d.ts +13 -0
- package/dist/presets/nodejs-server.d.ts +14 -0
- package/dist/presets/nodejs-serverless.d.ts +14 -0
- package/dist/presets/realtime-app.d.ts +11 -0
- package/dist/presets/static-site.d.ts +12 -0
- package/dist/presets/traditional-web-app.d.ts +16 -0
- package/dist/presets/wordpress.d.ts +12 -0
- package/dist/preview/github.d.ts +32 -0
- package/dist/preview/github.test.d.ts +1 -0
- package/dist/preview/index.d.ts +10 -0
- package/dist/preview/manager.d.ts +101 -0
- package/dist/preview/manager.test.d.ts +1 -0
- package/dist/preview/notifications.d.ts +89 -0
- package/dist/preview/notifications.test.d.ts +1 -0
- package/dist/queue/batch-processing.d.ts +138 -0
- package/dist/queue/dlq-monitoring.d.ts +143 -0
- package/dist/queue/fifo.d.ts +131 -0
- package/dist/queue/index.d.ts +8 -0
- package/dist/queue/management.d.ts +162 -0
- package/dist/queue/queue.test.d.ts +1 -0
- package/dist/resource-mgmt/index.d.ts +44 -0
- package/dist/resource-naming.d.ts +26 -0
- package/dist/s3/index.d.ts +227 -0
- package/dist/schema/index.d.ts +12 -0
- package/dist/security/certificate-manager.d.ts +184 -0
- package/dist/security/index.d.ts +8 -0
- package/dist/security/scanning.d.ts +196 -0
- package/dist/security/secrets-manager.d.ts +204 -0
- package/dist/security/secrets-rotation.d.ts +167 -0
- package/dist/security/security.test.d.ts +1 -0
- package/dist/sms/advanced/ab-testing.d.ts +74 -0
- package/dist/sms/advanced/analytics.d.ts +75 -0
- package/dist/sms/advanced/campaigns.d.ts +96 -0
- package/dist/sms/advanced/chatbot.d.ts +67 -0
- package/dist/sms/advanced/index.d.ts +9 -0
- package/dist/sms/advanced/link-tracking.d.ts +60 -0
- package/dist/sms/advanced/mms.d.ts +60 -0
- package/dist/sms/handlers/__tests__/send.test.d.ts +1 -0
- package/dist/sms/handlers/delivery-status.d.ts +10 -0
- package/dist/sms/handlers/receive.d.ts +10 -0
- package/dist/sms/handlers/send.d.ts +10 -0
- package/dist/sms/index.d.ts +5 -0
- package/dist/stack-diff.d.ts +38 -0
- package/dist/static-site/index.d.ts +49 -0
- package/dist/template-builder.d.ts +42 -0
- package/dist/template-validator.d.ts +28 -0
- package/dist/types.d.ts +2514 -0
- package/dist/utils/cache.d.ts +117 -0
- package/dist/utils/diff.d.ts +52 -0
- package/dist/utils/hash.d.ts +73 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/parallel.d.ts +78 -0
- package/dist/validators/credentials.d.ts +30 -0
- package/dist/validators/credentials.test.d.ts +4 -0
- package/dist/validators/quotas.d.ts +64 -0
- package/dist/validators/quotas.test.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import type { CloudWatchAlarm, CloudWatchDashboard, CloudWatchLogGroup, CloudWatchLogStream, CloudWatchMetricFilter, CloudWatchCompositeAlarm } from '@ts-cloud/aws-types';
|
|
2
|
+
import type { EnvironmentType } from '../types';
|
|
3
|
+
export interface AlarmOptions {
|
|
4
|
+
slug: string;
|
|
5
|
+
environment: EnvironmentType;
|
|
6
|
+
alarmName?: string;
|
|
7
|
+
metricName: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
statistic?: 'Average' | 'Sum' | 'Minimum' | 'Maximum' | 'SampleCount';
|
|
10
|
+
period?: number;
|
|
11
|
+
evaluationPeriods?: number;
|
|
12
|
+
threshold: number;
|
|
13
|
+
comparisonOperator: 'GreaterThanThreshold' | 'GreaterThanOrEqualToThreshold' | 'LessThanThreshold' | 'LessThanOrEqualToThreshold';
|
|
14
|
+
treatMissingData?: 'breaching' | 'notBreaching' | 'ignore' | 'missing';
|
|
15
|
+
actionsEnabled?: boolean;
|
|
16
|
+
alarmActions?: string[];
|
|
17
|
+
okActions?: string[];
|
|
18
|
+
insufficientDataActions?: string[];
|
|
19
|
+
dimensions?: Record<string, string>;
|
|
20
|
+
unit?: string;
|
|
21
|
+
datapointsToAlarm?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface DashboardOptions {
|
|
24
|
+
slug: string;
|
|
25
|
+
environment: EnvironmentType;
|
|
26
|
+
dashboardName?: string;
|
|
27
|
+
widgets: DashboardWidget[];
|
|
28
|
+
}
|
|
29
|
+
export interface DashboardWidget {
|
|
30
|
+
type: 'metric' | 'log' | 'text' | 'alarm';
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
properties: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export interface LogGroupOptions {
|
|
38
|
+
slug: string;
|
|
39
|
+
environment: EnvironmentType;
|
|
40
|
+
logGroupName?: string;
|
|
41
|
+
retentionInDays?: number;
|
|
42
|
+
kmsKeyId?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface LogStreamOptions {
|
|
45
|
+
slug: string;
|
|
46
|
+
environment: EnvironmentType;
|
|
47
|
+
logStreamName?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface MetricFilterOptions {
|
|
50
|
+
slug: string;
|
|
51
|
+
environment: EnvironmentType;
|
|
52
|
+
filterName?: string;
|
|
53
|
+
filterPattern: string;
|
|
54
|
+
metricTransformations: MetricTransformation[];
|
|
55
|
+
}
|
|
56
|
+
export interface MetricTransformation {
|
|
57
|
+
metricName: string;
|
|
58
|
+
metricNamespace: string;
|
|
59
|
+
metricValue: string;
|
|
60
|
+
defaultValue?: number;
|
|
61
|
+
unit?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CompositeAlarmOptions {
|
|
64
|
+
slug: string;
|
|
65
|
+
environment: EnvironmentType;
|
|
66
|
+
alarmName?: string;
|
|
67
|
+
alarmRule: string;
|
|
68
|
+
actionsEnabled?: boolean;
|
|
69
|
+
alarmActions?: string[];
|
|
70
|
+
okActions?: string[];
|
|
71
|
+
insufficientDataActions?: string[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Monitoring Module - CloudWatch
|
|
75
|
+
* Provides clean API for alarms, dashboards, logs, and metrics
|
|
76
|
+
*/
|
|
77
|
+
export declare class Monitoring {
|
|
78
|
+
/**
|
|
79
|
+
* Create a CloudWatch alarm
|
|
80
|
+
*/
|
|
81
|
+
static createAlarm(options: AlarmOptions): {
|
|
82
|
+
alarm: CloudWatchAlarm;
|
|
83
|
+
logicalId: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Create a composite alarm (combines multiple alarms)
|
|
87
|
+
*/
|
|
88
|
+
static createCompositeAlarm(options: CompositeAlarmOptions): {
|
|
89
|
+
alarm: CloudWatchCompositeAlarm;
|
|
90
|
+
logicalId: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Create a CloudWatch dashboard
|
|
94
|
+
*/
|
|
95
|
+
static createDashboard(options: DashboardOptions): {
|
|
96
|
+
dashboard: CloudWatchDashboard;
|
|
97
|
+
logicalId: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Create a CloudWatch log group
|
|
101
|
+
*/
|
|
102
|
+
static createLogGroup(options: LogGroupOptions): {
|
|
103
|
+
logGroup: CloudWatchLogGroup;
|
|
104
|
+
logicalId: string;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Create a CloudWatch log stream
|
|
108
|
+
*/
|
|
109
|
+
static createLogStream(logGroupLogicalId: string, options: LogStreamOptions): {
|
|
110
|
+
logStream: CloudWatchLogStream;
|
|
111
|
+
logicalId: string;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Create a metric filter for log group
|
|
115
|
+
*/
|
|
116
|
+
static createMetricFilter(logGroupLogicalId: string, options: MetricFilterOptions): {
|
|
117
|
+
metricFilter: CloudWatchMetricFilter;
|
|
118
|
+
logicalId: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Common alarm configurations
|
|
122
|
+
*/
|
|
123
|
+
static readonly AlarmTypes: {
|
|
124
|
+
/**
|
|
125
|
+
* High CPU utilization alarm
|
|
126
|
+
*/
|
|
127
|
+
readonly highCpu: (slug: string, environment: EnvironmentType, resourceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
128
|
+
/**
|
|
129
|
+
* High memory utilization alarm
|
|
130
|
+
*/
|
|
131
|
+
readonly highMemory: (slug: string, environment: EnvironmentType, resourceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
132
|
+
/**
|
|
133
|
+
* High disk utilization alarm
|
|
134
|
+
*/
|
|
135
|
+
readonly highDisk: (slug: string, environment: EnvironmentType, resourceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
136
|
+
/**
|
|
137
|
+
* Lambda error rate alarm
|
|
138
|
+
*/
|
|
139
|
+
readonly lambdaErrors: (slug: string, environment: EnvironmentType, functionName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
140
|
+
/**
|
|
141
|
+
* Lambda throttles alarm
|
|
142
|
+
*/
|
|
143
|
+
readonly lambdaThrottles: (slug: string, environment: EnvironmentType, functionName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
144
|
+
/**
|
|
145
|
+
* API Gateway 5xx errors alarm
|
|
146
|
+
*/
|
|
147
|
+
readonly apiGateway5xxErrors: (slug: string, environment: EnvironmentType, apiName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
148
|
+
/**
|
|
149
|
+
* API Gateway 4xx errors alarm
|
|
150
|
+
*/
|
|
151
|
+
readonly apiGateway4xxErrors: (slug: string, environment: EnvironmentType, apiName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
152
|
+
/**
|
|
153
|
+
* DynamoDB throttled requests alarm
|
|
154
|
+
*/
|
|
155
|
+
readonly dynamoDBThrottles: (slug: string, environment: EnvironmentType, tableName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
156
|
+
/**
|
|
157
|
+
* RDS CPU alarm
|
|
158
|
+
*/
|
|
159
|
+
readonly rdsCpu: (slug: string, environment: EnvironmentType, dbInstanceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
160
|
+
/**
|
|
161
|
+
* RDS free storage alarm
|
|
162
|
+
*/
|
|
163
|
+
readonly rdsFreeStorage: (slug: string, environment: EnvironmentType, dbInstanceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
164
|
+
/**
|
|
165
|
+
* SQS queue depth alarm
|
|
166
|
+
*/
|
|
167
|
+
readonly sqsQueueDepth: (slug: string, environment: EnvironmentType, queueName: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
168
|
+
/**
|
|
169
|
+
* ALB target unhealthy alarm
|
|
170
|
+
*/
|
|
171
|
+
readonly albUnhealthyTargets: (slug: string, environment: EnvironmentType, loadBalancer: string, targetGroup: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
172
|
+
/**
|
|
173
|
+
* SES bounce rate alarm
|
|
174
|
+
*/
|
|
175
|
+
readonly sesBounceRate: (slug: string, environment: EnvironmentType, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
176
|
+
/**
|
|
177
|
+
* SES complaint rate alarm
|
|
178
|
+
*/
|
|
179
|
+
readonly sesComplaintRate: (slug: string, environment: EnvironmentType, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
180
|
+
/**
|
|
181
|
+
* Pinpoint SMS delivery failure alarm
|
|
182
|
+
*/
|
|
183
|
+
readonly smsDeliveryFailure: (slug: string, environment: EnvironmentType, applicationId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
184
|
+
/**
|
|
185
|
+
* Pinpoint SMS spend alarm
|
|
186
|
+
*/
|
|
187
|
+
readonly smsSpendLimit: (slug: string, environment: EnvironmentType, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
188
|
+
/**
|
|
189
|
+
* Connect missed calls alarm
|
|
190
|
+
*/
|
|
191
|
+
readonly connectMissedCalls: (slug: string, environment: EnvironmentType, instanceId: string, threshold?: number, snsTopicArn?: string) => AlarmOptions;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Common dashboard widgets
|
|
195
|
+
*/
|
|
196
|
+
static readonly DashboardWidgets: {
|
|
197
|
+
/**
|
|
198
|
+
* Metric widget
|
|
199
|
+
*/
|
|
200
|
+
readonly metric: (x: number, y: number, width: number, height: number, metrics: Array<[string, string, Record<string, string>?]>, title?: string) => DashboardWidget;
|
|
201
|
+
/**
|
|
202
|
+
* Text widget
|
|
203
|
+
*/
|
|
204
|
+
readonly text: (x: number, y: number, width: number, height: number, markdown: string) => DashboardWidget;
|
|
205
|
+
/**
|
|
206
|
+
* Log widget
|
|
207
|
+
*/
|
|
208
|
+
readonly log: (x: number, y: number, width: number, height: number, logGroupNames: string[], title?: string) => DashboardWidget;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Common log retention periods
|
|
212
|
+
*/
|
|
213
|
+
static readonly RetentionPeriods: {
|
|
214
|
+
readonly ONE_DAY: 1;
|
|
215
|
+
readonly THREE_DAYS: 3;
|
|
216
|
+
readonly FIVE_DAYS: 5;
|
|
217
|
+
readonly ONE_WEEK: 7;
|
|
218
|
+
readonly TWO_WEEKS: 14;
|
|
219
|
+
readonly ONE_MONTH: 30;
|
|
220
|
+
readonly TWO_MONTHS: 60;
|
|
221
|
+
readonly THREE_MONTHS: 90;
|
|
222
|
+
readonly FOUR_MONTHS: 120;
|
|
223
|
+
readonly FIVE_MONTHS: 150;
|
|
224
|
+
readonly SIX_MONTHS: 180;
|
|
225
|
+
readonly ONE_YEAR: 365;
|
|
226
|
+
readonly THIRTEEN_MONTHS: 400;
|
|
227
|
+
readonly EIGHTEEN_MONTHS: 545;
|
|
228
|
+
readonly TWO_YEARS: 731;
|
|
229
|
+
readonly FIVE_YEARS: 1827;
|
|
230
|
+
readonly TEN_YEARS: 3653;
|
|
231
|
+
readonly NEVER_EXPIRE: undefined;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Common metric filter patterns
|
|
235
|
+
*/
|
|
236
|
+
static readonly FilterPatterns: {
|
|
237
|
+
/**
|
|
238
|
+
* Match ERROR log lines
|
|
239
|
+
*/
|
|
240
|
+
readonly errors: "[time, request_id, event_type = ERROR*, ...]";
|
|
241
|
+
/**
|
|
242
|
+
* Match all log lines
|
|
243
|
+
*/
|
|
244
|
+
readonly all: "";
|
|
245
|
+
/**
|
|
246
|
+
* Match JSON logs with specific field
|
|
247
|
+
*/
|
|
248
|
+
readonly jsonField: (field: string, value: string) => string;
|
|
249
|
+
/**
|
|
250
|
+
* Match HTTP status codes
|
|
251
|
+
*/
|
|
252
|
+
readonly httpStatus: (statusCode: number) => string;
|
|
253
|
+
/**
|
|
254
|
+
* Match 4xx errors
|
|
255
|
+
*/
|
|
256
|
+
readonly http4xx: "[..., status_code = 4*, ...]";
|
|
257
|
+
/**
|
|
258
|
+
* Match 5xx errors
|
|
259
|
+
*/
|
|
260
|
+
readonly http5xx: "[..., status_code = 5*, ...]";
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Create a comprehensive application dashboard
|
|
264
|
+
*/
|
|
265
|
+
static createApplicationDashboard(options: {
|
|
266
|
+
slug: string;
|
|
267
|
+
environment: EnvironmentType;
|
|
268
|
+
region?: string;
|
|
269
|
+
components?: {
|
|
270
|
+
ec2InstanceIds?: string[];
|
|
271
|
+
lambdaFunctionNames?: string[];
|
|
272
|
+
ecsClusterName?: string;
|
|
273
|
+
ecsServiceName?: string;
|
|
274
|
+
albName?: string;
|
|
275
|
+
targetGroupName?: string;
|
|
276
|
+
rdsInstanceId?: string;
|
|
277
|
+
sqsQueueNames?: string[];
|
|
278
|
+
logGroupNames?: string[];
|
|
279
|
+
};
|
|
280
|
+
}): {
|
|
281
|
+
dashboard: CloudWatchDashboard;
|
|
282
|
+
logicalId: string;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Dashboard templates for common architectures
|
|
286
|
+
*/
|
|
287
|
+
static readonly DashboardTemplates: {
|
|
288
|
+
/**
|
|
289
|
+
* Static website dashboard (S3 + CloudFront)
|
|
290
|
+
*/
|
|
291
|
+
staticWebsite: (options: {
|
|
292
|
+
slug: string;
|
|
293
|
+
environment: EnvironmentType;
|
|
294
|
+
region?: string;
|
|
295
|
+
cloudFrontDistributionId: string;
|
|
296
|
+
s3BucketName: string;
|
|
297
|
+
}) => DashboardOptions;
|
|
298
|
+
/**
|
|
299
|
+
* Serverless API dashboard (Lambda + API Gateway)
|
|
300
|
+
*/
|
|
301
|
+
serverlessApi: (options: {
|
|
302
|
+
slug: string;
|
|
303
|
+
environment: EnvironmentType;
|
|
304
|
+
region?: string;
|
|
305
|
+
apiGatewayName: string;
|
|
306
|
+
lambdaFunctionNames: string[];
|
|
307
|
+
}) => DashboardOptions;
|
|
308
|
+
/**
|
|
309
|
+
* Container service dashboard (ECS + ALB)
|
|
310
|
+
*/
|
|
311
|
+
containerService: (options: {
|
|
312
|
+
slug: string;
|
|
313
|
+
environment: EnvironmentType;
|
|
314
|
+
region?: string;
|
|
315
|
+
ecsClusterName: string;
|
|
316
|
+
ecsServiceName: string;
|
|
317
|
+
albName: string;
|
|
318
|
+
rdsInstanceId?: string;
|
|
319
|
+
}) => DashboardOptions;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Monitoring Configuration helpers
|
|
323
|
+
* Provides Stacks configuration parity for monitoring options
|
|
324
|
+
*/
|
|
325
|
+
static readonly Config: {
|
|
326
|
+
/**
|
|
327
|
+
* Create alarm configuration
|
|
328
|
+
*/
|
|
329
|
+
createAlarmConfig: (options: {
|
|
330
|
+
metricName: string;
|
|
331
|
+
namespace: string;
|
|
332
|
+
threshold: number;
|
|
333
|
+
comparisonOperator?: "GreaterThanThreshold" | "GreaterThanOrEqualToThreshold" | "LessThanThreshold" | "LessThanOrEqualToThreshold";
|
|
334
|
+
evaluationPeriods?: number;
|
|
335
|
+
period?: number;
|
|
336
|
+
statistic?: "Average" | "Sum" | "Maximum" | "Minimum" | "SampleCount";
|
|
337
|
+
treatMissingData?: "breaching" | "notBreaching" | "ignore" | "missing";
|
|
338
|
+
}) => {
|
|
339
|
+
MetricName: string;
|
|
340
|
+
Namespace: string;
|
|
341
|
+
Threshold: number;
|
|
342
|
+
ComparisonOperator: string;
|
|
343
|
+
EvaluationPeriods: number;
|
|
344
|
+
Period: number;
|
|
345
|
+
Statistic: string;
|
|
346
|
+
TreatMissingData: string;
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* AWS namespace constants
|
|
350
|
+
*/
|
|
351
|
+
namespaces: {
|
|
352
|
+
readonly ec2: "AWS/EC2";
|
|
353
|
+
readonly ecs: "AWS/ECS";
|
|
354
|
+
readonly lambda: "AWS/Lambda";
|
|
355
|
+
readonly rds: "AWS/RDS";
|
|
356
|
+
readonly sqs: "AWS/SQS";
|
|
357
|
+
readonly sns: "AWS/SNS";
|
|
358
|
+
readonly s3: "AWS/S3";
|
|
359
|
+
readonly cloudfront: "AWS/CloudFront";
|
|
360
|
+
readonly alb: "AWS/ApplicationELB";
|
|
361
|
+
readonly nlb: "AWS/NetworkELB";
|
|
362
|
+
readonly apiGateway: "AWS/ApiGateway";
|
|
363
|
+
readonly dynamodb: "AWS/DynamoDB";
|
|
364
|
+
readonly elasticache: "AWS/ElastiCache";
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* Comparison operator options
|
|
368
|
+
*/
|
|
369
|
+
comparisonOperators: {
|
|
370
|
+
readonly greaterThan: "GreaterThanThreshold";
|
|
371
|
+
readonly greaterOrEqual: "GreaterThanOrEqualToThreshold";
|
|
372
|
+
readonly lessThan: "LessThanThreshold";
|
|
373
|
+
readonly lessOrEqual: "LessThanOrEqualToThreshold";
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Common metric configurations by service
|
|
377
|
+
*/
|
|
378
|
+
metrics: {
|
|
379
|
+
ec2: {
|
|
380
|
+
cpu: {
|
|
381
|
+
metricName: string;
|
|
382
|
+
namespace: string;
|
|
383
|
+
};
|
|
384
|
+
networkIn: {
|
|
385
|
+
metricName: string;
|
|
386
|
+
namespace: string;
|
|
387
|
+
};
|
|
388
|
+
networkOut: {
|
|
389
|
+
metricName: string;
|
|
390
|
+
namespace: string;
|
|
391
|
+
};
|
|
392
|
+
statusCheck: {
|
|
393
|
+
metricName: string;
|
|
394
|
+
namespace: string;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
ecs: {
|
|
398
|
+
cpu: {
|
|
399
|
+
metricName: string;
|
|
400
|
+
namespace: string;
|
|
401
|
+
};
|
|
402
|
+
memory: {
|
|
403
|
+
metricName: string;
|
|
404
|
+
namespace: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
lambda: {
|
|
408
|
+
invocations: {
|
|
409
|
+
metricName: string;
|
|
410
|
+
namespace: string;
|
|
411
|
+
};
|
|
412
|
+
errors: {
|
|
413
|
+
metricName: string;
|
|
414
|
+
namespace: string;
|
|
415
|
+
};
|
|
416
|
+
duration: {
|
|
417
|
+
metricName: string;
|
|
418
|
+
namespace: string;
|
|
419
|
+
};
|
|
420
|
+
throttles: {
|
|
421
|
+
metricName: string;
|
|
422
|
+
namespace: string;
|
|
423
|
+
};
|
|
424
|
+
concurrentExecutions: {
|
|
425
|
+
metricName: string;
|
|
426
|
+
namespace: string;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
rds: {
|
|
430
|
+
cpu: {
|
|
431
|
+
metricName: string;
|
|
432
|
+
namespace: string;
|
|
433
|
+
};
|
|
434
|
+
connections: {
|
|
435
|
+
metricName: string;
|
|
436
|
+
namespace: string;
|
|
437
|
+
};
|
|
438
|
+
freeStorage: {
|
|
439
|
+
metricName: string;
|
|
440
|
+
namespace: string;
|
|
441
|
+
};
|
|
442
|
+
readLatency: {
|
|
443
|
+
metricName: string;
|
|
444
|
+
namespace: string;
|
|
445
|
+
};
|
|
446
|
+
writeLatency: {
|
|
447
|
+
metricName: string;
|
|
448
|
+
namespace: string;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
alb: {
|
|
452
|
+
requestCount: {
|
|
453
|
+
metricName: string;
|
|
454
|
+
namespace: string;
|
|
455
|
+
};
|
|
456
|
+
responseTime: {
|
|
457
|
+
metricName: string;
|
|
458
|
+
namespace: string;
|
|
459
|
+
};
|
|
460
|
+
httpCode4xx: {
|
|
461
|
+
metricName: string;
|
|
462
|
+
namespace: string;
|
|
463
|
+
};
|
|
464
|
+
httpCode5xx: {
|
|
465
|
+
metricName: string;
|
|
466
|
+
namespace: string;
|
|
467
|
+
};
|
|
468
|
+
healthyHosts: {
|
|
469
|
+
metricName: string;
|
|
470
|
+
namespace: string;
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
sqs: {
|
|
474
|
+
messagesVisible: {
|
|
475
|
+
metricName: string;
|
|
476
|
+
namespace: string;
|
|
477
|
+
};
|
|
478
|
+
messagesDelayed: {
|
|
479
|
+
metricName: string;
|
|
480
|
+
namespace: string;
|
|
481
|
+
};
|
|
482
|
+
messageAge: {
|
|
483
|
+
metricName: string;
|
|
484
|
+
namespace: string;
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* Common alarm presets
|
|
490
|
+
*/
|
|
491
|
+
presets: {
|
|
492
|
+
/**
|
|
493
|
+
* High CPU alarm
|
|
494
|
+
*/
|
|
495
|
+
highCpu: (threshold?: number) => {
|
|
496
|
+
metricName: string;
|
|
497
|
+
threshold: number;
|
|
498
|
+
comparisonOperator: "GreaterThanThreshold";
|
|
499
|
+
evaluationPeriods: number;
|
|
500
|
+
period: number;
|
|
501
|
+
statistic: "Average";
|
|
502
|
+
};
|
|
503
|
+
/**
|
|
504
|
+
* High memory alarm (for ECS)
|
|
505
|
+
*/
|
|
506
|
+
highMemory: (threshold?: number) => {
|
|
507
|
+
metricName: string;
|
|
508
|
+
threshold: number;
|
|
509
|
+
comparisonOperator: "GreaterThanThreshold";
|
|
510
|
+
evaluationPeriods: number;
|
|
511
|
+
period: number;
|
|
512
|
+
statistic: "Average";
|
|
513
|
+
};
|
|
514
|
+
/**
|
|
515
|
+
* High error rate alarm
|
|
516
|
+
*/
|
|
517
|
+
highErrors: (threshold?: number) => {
|
|
518
|
+
metricName: string;
|
|
519
|
+
threshold: number;
|
|
520
|
+
comparisonOperator: "GreaterThanThreshold";
|
|
521
|
+
evaluationPeriods: number;
|
|
522
|
+
period: number;
|
|
523
|
+
statistic: "Sum";
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* High latency alarm
|
|
527
|
+
*/
|
|
528
|
+
highLatency: (threshold?: number) => {
|
|
529
|
+
metricName: string;
|
|
530
|
+
threshold: number;
|
|
531
|
+
comparisonOperator: "GreaterThanThreshold";
|
|
532
|
+
evaluationPeriods: number;
|
|
533
|
+
period: number;
|
|
534
|
+
statistic: "Average";
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* Low healthy hosts alarm
|
|
538
|
+
*/
|
|
539
|
+
lowHealthyHosts: (threshold?: number) => {
|
|
540
|
+
metricName: string;
|
|
541
|
+
namespace: string;
|
|
542
|
+
threshold: number;
|
|
543
|
+
comparisonOperator: "LessThanThreshold";
|
|
544
|
+
evaluationPeriods: number;
|
|
545
|
+
period: number;
|
|
546
|
+
statistic: "Minimum";
|
|
547
|
+
};
|
|
548
|
+
/**
|
|
549
|
+
* Queue depth alarm
|
|
550
|
+
*/
|
|
551
|
+
queueDepth: (threshold?: number) => {
|
|
552
|
+
metricName: string;
|
|
553
|
+
namespace: string;
|
|
554
|
+
threshold: number;
|
|
555
|
+
comparisonOperator: "GreaterThanThreshold";
|
|
556
|
+
evaluationPeriods: number;
|
|
557
|
+
period: number;
|
|
558
|
+
statistic: "Average";
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Low storage alarm
|
|
562
|
+
*/
|
|
563
|
+
lowStorage: (threshold?: number) => {
|
|
564
|
+
metricName: string;
|
|
565
|
+
namespace: string;
|
|
566
|
+
threshold: number;
|
|
567
|
+
comparisonOperator: "LessThanThreshold";
|
|
568
|
+
evaluationPeriods: number;
|
|
569
|
+
period: number;
|
|
570
|
+
statistic: "Average";
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
}
|