@hasna/uptime 0.1.4 → 0.1.6

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.
@@ -0,0 +1,166 @@
1
+ variable "account_name" {
2
+ description = "Human-readable AWS account/profile label."
3
+ type = string
4
+ default = "hasna-xyz-infra"
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.hasna.xyz"
29
+ }
30
+
31
+ variable "workspace_id" {
32
+ description = "Hosted Open Uptime workspace id."
33
+ type = string
34
+ default = "wks_2tyysw05cwap"
35
+ }
36
+
37
+ variable "vpc_id" {
38
+ description = "Existing VPC id."
39
+ type = string
40
+ default = "vpc-04c7f7abc1d3c3f56"
41
+ }
42
+
43
+ variable "public_subnet_ids" {
44
+ description = "Public subnets for the ALB."
45
+ type = list(string)
46
+ }
47
+
48
+ variable "alb_ingress_cidr_blocks" {
49
+ description = "Approved HTTPS source CIDR blocks for the ALB. Keep empty until edge/source policy is approved."
50
+ type = list(string)
51
+ default = []
52
+ }
53
+
54
+ variable "private_subnet_ids" {
55
+ description = "Private application subnets for ECS tasks."
56
+ type = list(string)
57
+ }
58
+
59
+ variable "rds_security_group_id" {
60
+ description = "Existing RDS security group id that should allow Open Uptime client access."
61
+ type = string
62
+ }
63
+
64
+ variable "container_image" {
65
+ description = "Immutable Open Uptime image URI, preferably with digest."
66
+ type = string
67
+
68
+ validation {
69
+ condition = can(regex("@sha256:[a-f0-9]{64}$", var.container_image))
70
+ error_message = "container_image must be an immutable image digest ending in @sha256:<64 hex chars>."
71
+ }
72
+ }
73
+
74
+ variable "certificate_arn" {
75
+ description = "ACM certificate ARN for HTTPS listener."
76
+ type = string
77
+ }
78
+
79
+ variable "hosted_zone_id" {
80
+ description = "Route53 hosted zone id. Leave null to skip DNS record creation."
81
+ type = string
82
+ default = null
83
+ }
84
+
85
+ variable "database_secret_arn" {
86
+ description = "Secrets Manager/SSM ARN containing DATABASE_URL."
87
+ type = string
88
+
89
+ validation {
90
+ condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.database_secret_arn))
91
+ error_message = "database_secret_arn must be a Secrets Manager or SSM ARN, not a plaintext database URL."
92
+ }
93
+ }
94
+
95
+ variable "app_env_secret_arn" {
96
+ description = "Secrets Manager/SSM ARN containing hosted app environment refs."
97
+ type = string
98
+
99
+ validation {
100
+ condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.app_env_secret_arn))
101
+ error_message = "app_env_secret_arn must be a Secrets Manager or SSM ARN."
102
+ }
103
+ }
104
+
105
+ variable "hosted_token_secret_arn" {
106
+ description = "Secrets Manager/SSM ARN containing HASNA_UPTIME_HOSTED_TOKEN for hosted web auth bootstrap."
107
+ type = string
108
+
109
+ validation {
110
+ condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.hosted_token_secret_arn))
111
+ error_message = "hosted_token_secret_arn must be a Secrets Manager or SSM ARN."
112
+ }
113
+ }
114
+
115
+ variable "public_probe_secret_arn" {
116
+ description = "Secrets Manager/SSM ARN containing public probe config refs."
117
+ type = string
118
+
119
+ validation {
120
+ condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.public_probe_secret_arn))
121
+ error_message = "public_probe_secret_arn must be a Secrets Manager or SSM ARN."
122
+ }
123
+ }
124
+
125
+ variable "reporting_secret_arn" {
126
+ description = "Secrets Manager/SSM ARN containing Mailery/Telephony/Open Logs channel refs."
127
+ type = string
128
+
129
+ validation {
130
+ condition = can(regex("^arn:aws:(secretsmanager|ssm):", var.reporting_secret_arn))
131
+ error_message = "reporting_secret_arn must be a Secrets Manager or SSM ARN."
132
+ }
133
+ }
134
+
135
+ variable "kms_key_arn" {
136
+ description = "KMS key ARN for S3, logs, and secret-decrypt permissions."
137
+ type = string
138
+
139
+ validation {
140
+ condition = can(regex("^arn:aws:kms:", var.kms_key_arn))
141
+ error_message = "kms_key_arn must be a KMS key ARN."
142
+ }
143
+ }
144
+
145
+ variable "desired_counts" {
146
+ description = "Desired ECS service counts. Keep all at 0 until app/runtime blockers are closed."
147
+ type = map(number)
148
+ default = {
149
+ web = 0
150
+ scheduler = 0
151
+ "public-probe" = 0
152
+ reporter = 0
153
+ migration = 0
154
+ }
155
+
156
+ validation {
157
+ condition = alltrue([for count in values(var.desired_counts) : count >= 0])
158
+ error_message = "desired_counts values must be non-negative."
159
+ }
160
+ }
161
+
162
+ variable "alarm_actions" {
163
+ description = "Optional SNS topic ARNs or other CloudWatch alarm action ARNs."
164
+ type = list(string)
165
+ default = []
166
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/uptime",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
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
+ ".dockerignore",
28
+ "infra/aws/README.md",
29
+ "infra/aws/.terraform.lock.hcl",
30
+ "infra/aws/*.tf",
31
+ "infra/aws/terraform.tfvars.example",
32
+ "docs/aws-deployment-runbook.md",
26
33
  "CHANGELOG.md",
27
34
  "LICENSE",
28
35
  "NOTICE",
@@ -55,10 +62,14 @@
55
62
  "./probes": {
56
63
  "types": "./dist/probes.d.ts",
57
64
  "import": "./dist/probes.js"
65
+ },
66
+ "./cloud-plan": {
67
+ "types": "./dist/cloud-plan.d.ts",
68
+ "import": "./dist/cloud-plan.js"
58
69
  }
59
70
  },
60
71
  "scripts": {
61
- "build": "rm -rf dist && bun build src/cli/index.ts --outdir dist/cli --target bun --external @modelcontextprotocol/sdk && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk && bun build src/index.ts src/api.ts src/service.ts src/store.ts src/checks.ts src/imports.ts src/report.ts src/probes.ts src/types.ts src/paths.ts src/dashboard.ts src/version.ts --root src --outdir dist --target bun && tsc -p tsconfig.build.json --emitDeclarationOnly --outDir dist && chmod +x dist/cli/index.js dist/mcp/index.js",
72
+ "build": "rm -rf dist && bun build src/cli/index.ts --outdir dist/cli --target bun --external @modelcontextprotocol/sdk && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk && bun build src/index.ts src/api.ts src/service.ts src/store.ts src/checks.ts src/imports.ts src/report.ts src/probes.ts src/cloud-plan.ts src/types.ts src/paths.ts src/dashboard.ts src/version.ts --root src --outdir dist --target bun && tsc -p tsconfig.build.json --emitDeclarationOnly --outDir dist && chmod +x dist/cli/index.js dist/mcp/index.js",
62
73
  "typecheck": "tsc --noEmit",
63
74
  "test": "bun test ./tests",
64
75
  "dev:cli": "bun run src/cli/index.ts",