@hasna/uptime 0.1.5 → 0.1.7
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/.dockerignore +13 -0
- package/CHANGELOG.md +41 -3
- package/Dockerfile +31 -0
- package/Dockerfile.package +22 -0
- package/README.md +10 -0
- package/dist/api.js +38 -8
- package/dist/cli/index.js +110 -51
- package/dist/cloud-plan.d.ts +21 -4
- package/dist/cloud-plan.d.ts.map +1 -1
- package/dist/cloud-plan.js +59 -38
- package/dist/index.js +97 -46
- package/dist/mcp/index.js +38 -8
- package/dist/service.d.ts +1 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +38 -8
- package/dist/store.d.ts +3 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +40 -9
- package/docs/aws-deployment-runbook.md +48 -23
- package/infra/aws/.terraform.lock.hcl +25 -0
- package/infra/aws/README.md +43 -0
- package/infra/aws/main.tf +795 -0
- package/infra/aws/outputs.tf +34 -0
- package/infra/aws/terraform.tfvars.example +28 -0
- package/infra/aws/variables.tf +170 -0
- package/package.json +8 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
output "ecr_repository_url" {
|
|
2
|
+
value = aws_ecr_repository.open_uptime.repository_url
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
output "image_builder_project_name" {
|
|
6
|
+
value = aws_codebuild_project.image_builder.name
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
output "ecs_cluster_name" {
|
|
10
|
+
value = aws_ecs_cluster.open_uptime.name
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
output "alb_dns_name" {
|
|
14
|
+
value = aws_lb.open_uptime.dns_name
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
output "evidence_bucket" {
|
|
18
|
+
value = aws_s3_bucket.evidence.bucket
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
output "efs_file_system_id" {
|
|
22
|
+
value = aws_efs_file_system.data.id
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
output "efs_access_point_id" {
|
|
26
|
+
value = aws_efs_access_point.uptime.id
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
output "service_names" {
|
|
30
|
+
value = concat(
|
|
31
|
+
[aws_ecs_service.web.name],
|
|
32
|
+
[for service in aws_ecs_service.worker : service.name],
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
region = "us-east-1"
|
|
2
|
+
stage = "prod"
|
|
3
|
+
service_name = "open-uptime"
|
|
4
|
+
hostname = "uptime.example.com"
|
|
5
|
+
workspace_id = "workspace-id"
|
|
6
|
+
vpc_id = "vpc-xxxxxxxx"
|
|
7
|
+
ecr_repository_name = "open-uptime"
|
|
8
|
+
public_subnet_ids = ["subnet-replace-public-a", "subnet-replace-public-b"]
|
|
9
|
+
alb_ingress_cidr_blocks = []
|
|
10
|
+
private_subnet_ids = ["subnet-replace-private-a", "subnet-replace-private-b"]
|
|
11
|
+
container_image = "123456789012.dkr.ecr.us-east-1.amazonaws.com/open-uptime@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
12
|
+
runtime_package_version = "0.1.7"
|
|
13
|
+
certificate_arn = "arn:aws:acm:us-east-1:123456789012:certificate/replace"
|
|
14
|
+
hosted_zone_id = "ZREPLACE"
|
|
15
|
+
app_env_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:open-uptime/prod/app/env"
|
|
16
|
+
hosted_token_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:open-uptime/prod/hosted-token"
|
|
17
|
+
public_probe_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:open-uptime/prod/probe/public"
|
|
18
|
+
reporting_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:open-uptime/prod/reporting"
|
|
19
|
+
kms_key_arn = "arn:aws:kms:us-east-1:123456789012:key/00000000-0000-0000-0000-000000000000"
|
|
20
|
+
alarm_actions = []
|
|
21
|
+
|
|
22
|
+
desired_counts = {
|
|
23
|
+
web = 0
|
|
24
|
+
scheduler = 0
|
|
25
|
+
"public-probe" = 0
|
|
26
|
+
reporter = 0
|
|
27
|
+
migration = 0
|
|
28
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
variable "account_name" {
|
|
2
|
+
description = "Human-readable AWS account/profile label."
|
|
3
|
+
type = string
|
|
4
|
+
default = "aws-profile"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
variable "region" {
|
|
8
|
+
description = "AWS region."
|
|
9
|
+
type = string
|
|
10
|
+
default = "us-east-1"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
variable "stage" {
|
|
14
|
+
description = "Deployment stage."
|
|
15
|
+
type = string
|
|
16
|
+
default = "prod"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
variable "service_name" {
|
|
20
|
+
description = "Service name prefix."
|
|
21
|
+
type = string
|
|
22
|
+
default = "open-uptime"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
variable "hostname" {
|
|
26
|
+
description = "Public/internal hostname for Open Uptime."
|
|
27
|
+
type = string
|
|
28
|
+
default = "uptime.example.com"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
variable "workspace_id" {
|
|
32
|
+
description = "Hosted Open Uptime workspace id."
|
|
33
|
+
type = string
|
|
34
|
+
default = "workspace-id"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
variable "vpc_id" {
|
|
38
|
+
description = "Existing VPC id."
|
|
39
|
+
type = string
|
|
40
|
+
default = "vpc-xxxxxxxx"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
variable "ecr_repository_name" {
|
|
44
|
+
description = "ECR repository name for the Open Uptime image."
|
|
45
|
+
type = string
|
|
46
|
+
default = "open-uptime"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
variable "public_subnet_ids" {
|
|
50
|
+
description = "Public subnets for the ALB."
|
|
51
|
+
type = list(string)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
variable "alb_ingress_cidr_blocks" {
|
|
55
|
+
description = "Approved HTTPS source CIDR blocks for the ALB. Keep empty until edge/source policy is approved."
|
|
56
|
+
type = list(string)
|
|
57
|
+
default = []
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
variable "private_subnet_ids" {
|
|
61
|
+
description = "Private application subnets for ECS tasks."
|
|
62
|
+
type = list(string)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
variable "container_image" {
|
|
66
|
+
description = "Immutable Open Uptime image URI, preferably with digest."
|
|
67
|
+
type = string
|
|
68
|
+
|
|
69
|
+
validation {
|
|
70
|
+
condition = can(regex("@sha256:[a-f0-9]{64}$", var.container_image))
|
|
71
|
+
error_message = "container_image must be an immutable image digest ending in @sha256:<64 hex chars>."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
variable "runtime_package_version" {
|
|
76
|
+
description = "Published @hasna/uptime package version that CodeBuild should build into the ECR image."
|
|
77
|
+
type = string
|
|
78
|
+
default = "0.1.7"
|
|
79
|
+
|
|
80
|
+
validation {
|
|
81
|
+
condition = can(regex("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$", var.runtime_package_version))
|
|
82
|
+
error_message = "runtime_package_version must be a semver version without the package name."
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
variable "certificate_arn" {
|
|
87
|
+
description = "ACM certificate ARN for HTTPS listener."
|
|
88
|
+
type = string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
variable "hosted_zone_id" {
|
|
92
|
+
description = "Route53 hosted zone id. Leave null to skip DNS record creation."
|
|
93
|
+
type = string
|
|
94
|
+
default = null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
variable "app_env_secret_arn" {
|
|
98
|
+
description = "Secrets Manager/SSM ARN containing hosted app environment refs."
|
|
99
|
+
type = string
|
|
100
|
+
|
|
101
|
+
validation {
|
|
102
|
+
condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.app_env_secret_arn))
|
|
103
|
+
error_message = "app_env_secret_arn must be a Secrets Manager or SSM ARN."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
variable "hosted_token_secret_arn" {
|
|
108
|
+
description = "Secrets Manager/SSM ARN containing HASNA_UPTIME_HOSTED_TOKEN for hosted web auth bootstrap."
|
|
109
|
+
type = string
|
|
110
|
+
|
|
111
|
+
validation {
|
|
112
|
+
condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.hosted_token_secret_arn))
|
|
113
|
+
error_message = "hosted_token_secret_arn must be a Secrets Manager or SSM ARN."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
variable "public_probe_secret_arn" {
|
|
118
|
+
description = "Secrets Manager/SSM ARN containing public probe config refs."
|
|
119
|
+
type = string
|
|
120
|
+
|
|
121
|
+
validation {
|
|
122
|
+
condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.public_probe_secret_arn))
|
|
123
|
+
error_message = "public_probe_secret_arn must be a Secrets Manager or SSM ARN."
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
variable "reporting_secret_arn" {
|
|
128
|
+
description = "Secrets Manager/SSM ARN containing Mailery/Telephony/Open Logs channel refs."
|
|
129
|
+
type = string
|
|
130
|
+
|
|
131
|
+
validation {
|
|
132
|
+
condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.reporting_secret_arn))
|
|
133
|
+
error_message = "reporting_secret_arn must be a Secrets Manager or SSM ARN."
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
variable "kms_key_arn" {
|
|
138
|
+
description = "KMS key ARN for S3, logs, and secret-decrypt permissions."
|
|
139
|
+
type = string
|
|
140
|
+
|
|
141
|
+
validation {
|
|
142
|
+
condition = can(regex("^arn:aws:kms:", var.kms_key_arn))
|
|
143
|
+
error_message = "kms_key_arn must be a KMS key ARN."
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
variable "desired_counts" {
|
|
148
|
+
description = "Desired ECS service counts. Keep all at 0 until app/runtime blockers are closed."
|
|
149
|
+
type = map(number)
|
|
150
|
+
default = {
|
|
151
|
+
web = 0
|
|
152
|
+
scheduler = 0
|
|
153
|
+
"public-probe" = 0
|
|
154
|
+
reporter = 0
|
|
155
|
+
migration = 0
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
validation {
|
|
159
|
+
condition = alltrue([for count in values(var.desired_counts) : count >= 0]) && lookup(var.desired_counts, "web", 0) <= 1 && alltrue([
|
|
160
|
+
for key in ["scheduler", "public-probe", "reporter", "migration"] : lookup(var.desired_counts, key, 0) == 0
|
|
161
|
+
])
|
|
162
|
+
error_message = "EFS SQLite bridge requires web desired count 0 or 1 and scheduler/public-probe/reporter/migration desired counts 0."
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
variable "alarm_actions" {
|
|
167
|
+
description = "Optional SNS topic ARNs or other CloudWatch alarm action ARNs."
|
|
168
|
+
type = list(string)
|
|
169
|
+
default = []
|
|
170
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/uptime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Local-first uptime and downtime monitoring service with CLI, MCP, SDK, SQLite persistence, and a dashboard.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
25
|
"README.md",
|
|
26
|
+
"Dockerfile",
|
|
27
|
+
"Dockerfile.package",
|
|
28
|
+
".dockerignore",
|
|
29
|
+
"infra/aws/README.md",
|
|
30
|
+
"infra/aws/.terraform.lock.hcl",
|
|
31
|
+
"infra/aws/*.tf",
|
|
32
|
+
"infra/aws/terraform.tfvars.example",
|
|
26
33
|
"docs/aws-deployment-runbook.md",
|
|
27
34
|
"CHANGELOG.md",
|
|
28
35
|
"LICENSE",
|