@hasna/uptime 0.1.6 → 0.1.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.
@@ -1,7 +1,7 @@
1
1
  variable "account_name" {
2
2
  description = "Human-readable AWS account/profile label."
3
3
  type = string
4
- default = "hasna-xyz-infra"
4
+ default = "aws-profile"
5
5
  }
6
6
 
7
7
  variable "region" {
@@ -25,19 +25,36 @@ variable "service_name" {
25
25
  variable "hostname" {
26
26
  description = "Public/internal hostname for Open Uptime."
27
27
  type = string
28
- default = "uptime.hasna.xyz"
28
+ default = "uptime.example.com"
29
29
  }
30
30
 
31
31
  variable "workspace_id" {
32
32
  description = "Hosted Open Uptime workspace id."
33
33
  type = string
34
- default = "wks_2tyysw05cwap"
34
+ default = "workspace-id"
35
35
  }
36
36
 
37
37
  variable "vpc_id" {
38
38
  description = "Existing VPC id."
39
39
  type = string
40
- default = "vpc-04c7f7abc1d3c3f56"
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 "protected_access_mode" {
50
+ description = "Protected web access mode. cloudfront_default_domain uses the CloudFront HTTPS default domain and restricts ALB HTTP to CloudFront origin-facing ranges. alb_https_cert uses an ALB HTTPS listener with certificate_arn."
51
+ type = string
52
+ default = "cloudfront_default_domain"
53
+
54
+ validation {
55
+ condition = contains(["cloudfront_default_domain", "alb_https_cert"], var.protected_access_mode)
56
+ error_message = "protected_access_mode must be cloudfront_default_domain or alb_https_cert."
57
+ }
41
58
  }
42
59
 
43
60
  variable "public_subnet_ids" {
@@ -46,7 +63,7 @@ variable "public_subnet_ids" {
46
63
  }
47
64
 
48
65
  variable "alb_ingress_cidr_blocks" {
49
- description = "Approved HTTPS source CIDR blocks for the ALB. Keep empty until edge/source policy is approved."
66
+ description = "Approved HTTPS source CIDR blocks for ALB HTTPS mode. Keep empty until edge/source policy is approved."
50
67
  type = list(string)
51
68
  default = []
52
69
  }
@@ -56,11 +73,6 @@ variable "private_subnet_ids" {
56
73
  type = list(string)
57
74
  }
58
75
 
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
76
  variable "container_image" {
65
77
  description = "Immutable Open Uptime image URI, preferably with digest."
66
78
  type = string
@@ -71,27 +83,39 @@ variable "container_image" {
71
83
  }
72
84
  }
73
85
 
74
- variable "certificate_arn" {
75
- description = "ACM certificate ARN for HTTPS listener."
86
+ variable "runtime_package_version" {
87
+ description = "Published @hasna/uptime package version that CodeBuild should build into the ECR image."
76
88
  type = string
89
+ default = "0.1.8"
90
+
91
+ validation {
92
+ condition = can(regex("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$", var.runtime_package_version))
93
+ error_message = "runtime_package_version must be a semver version without the package name."
94
+ }
77
95
  }
78
96
 
79
- variable "hosted_zone_id" {
80
- description = "Route53 hosted zone id. Leave null to skip DNS record creation."
97
+ variable "certificate_arn" {
98
+ description = "ACM certificate ARN for ALB HTTPS mode. Leave null when protected_access_mode is cloudfront_default_domain."
81
99
  type = string
82
100
  default = null
83
- }
84
101
 
85
- variable "database_secret_arn" {
86
- description = "Secrets Manager/SSM ARN containing DATABASE_URL."
87
- type = string
102
+ validation {
103
+ condition = var.certificate_arn == null || can(regex("^arn:aws:acm:", var.certificate_arn))
104
+ error_message = "certificate_arn must be null or an ACM certificate ARN."
105
+ }
88
106
 
89
107
  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."
108
+ condition = var.protected_access_mode != "alb_https_cert" || var.certificate_arn != null
109
+ error_message = "certificate_arn is required when protected_access_mode is alb_https_cert."
92
110
  }
93
111
  }
94
112
 
113
+ variable "hosted_zone_id" {
114
+ description = "Route53 hosted zone id. Leave null to skip DNS record creation."
115
+ type = string
116
+ default = null
117
+ }
118
+
95
119
  variable "app_env_secret_arn" {
96
120
  description = "Secrets Manager/SSM ARN containing hosted app environment refs."
97
121
  type = string
@@ -154,8 +178,10 @@ variable "desired_counts" {
154
178
  }
155
179
 
156
180
  validation {
157
- condition = alltrue([for count in values(var.desired_counts) : count >= 0])
158
- error_message = "desired_counts values must be non-negative."
181
+ condition = alltrue([for count in values(var.desired_counts) : count >= 0]) && lookup(var.desired_counts, "web", 0) <= 1 && alltrue([
182
+ for key in ["scheduler", "public-probe", "reporter", "migration"] : lookup(var.desired_counts, key, 0) == 0
183
+ ])
184
+ error_message = "EFS SQLite bridge requires web desired count 0 or 1 and scheduler/public-probe/reporter/migration desired counts 0."
159
185
  }
160
186
  }
161
187
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/uptime",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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",
@@ -24,6 +24,7 @@
24
24
  "dist",
25
25
  "README.md",
26
26
  "Dockerfile",
27
+ "Dockerfile.package",
27
28
  ".dockerignore",
28
29
  "infra/aws/README.md",
29
30
  "infra/aws/.terraform.lock.hcl",