@hasna/uptime 0.1.24 → 0.1.25

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.
@@ -77,7 +77,7 @@ variable "ecr_repository_name" {
77
77
  }
78
78
 
79
79
  variable "protected_access_mode" {
80
- 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."
80
+ description = "Protected web access mode. cloudfront_default_domain uses the CloudFront HTTPS default domain and restricts the ALB origin to CloudFront origin-facing ranges. alb_https_cert uses an ALB HTTPS listener with certificate_arn."
81
81
  type = string
82
82
  default = "cloudfront_default_domain"
83
83
 
@@ -87,6 +87,40 @@ variable "protected_access_mode" {
87
87
  }
88
88
  }
89
89
 
90
+ variable "cloudfront_origin_protocol_policy" {
91
+ description = "CloudFront-to-ALB origin protocol policy. Keep http-only until an origin hostname and matching ACM certificate are approved; set https-only with cloudfront_origin_domain_name and certificate_arn before token-bearing live traffic."
92
+ type = string
93
+ default = "http-only"
94
+
95
+ validation {
96
+ condition = contains(["http-only", "https-only"], var.cloudfront_origin_protocol_policy)
97
+ error_message = "cloudfront_origin_protocol_policy must be http-only or https-only."
98
+ }
99
+ }
100
+
101
+ variable "cloudfront_origin_domain_name" {
102
+ description = "DNS hostname CloudFront uses for the ALB custom origin when cloudfront_origin_protocol_policy is https-only. The hostname must resolve to the ALB and match certificate_arn. Leave null for the default HTTP-origin bridge."
103
+ type = string
104
+ default = null
105
+ nullable = true
106
+
107
+ validation {
108
+ condition = (
109
+ var.cloudfront_origin_domain_name == null
110
+ || can(regex("^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$", var.cloudfront_origin_domain_name))
111
+ )
112
+ error_message = "cloudfront_origin_domain_name must be null or a valid DNS hostname."
113
+ }
114
+
115
+ validation {
116
+ condition = (
117
+ !(var.protected_access_mode == "cloudfront_default_domain" && var.cloudfront_origin_protocol_policy == "https-only")
118
+ || var.cloudfront_origin_domain_name != null
119
+ )
120
+ error_message = "cloudfront_origin_domain_name is required when CloudFront HTTPS origin is enabled."
121
+ }
122
+ }
123
+
90
124
  variable "enable_cloudfront_origin_verify_header" {
91
125
  description = "When true in cloudfront_default_domain mode, CloudFront sends a private origin header and the ALB listener rejects requests missing the matching value."
92
126
  type = bool
@@ -201,7 +235,7 @@ variable "container_image" {
201
235
  variable "runtime_package_version" {
202
236
  description = "Published @hasna/uptime package version that CodeBuild should build into the ECR image."
203
237
  type = string
204
- default = "0.1.24"
238
+ default = "0.1.25"
205
239
 
206
240
  validation {
207
241
  condition = can(regex("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$", var.runtime_package_version))
@@ -209,8 +243,20 @@ variable "runtime_package_version" {
209
243
  }
210
244
  }
211
245
 
246
+ variable "runtime_package_integrity" {
247
+ description = "Optional expected npm dist.integrity value for @hasna/uptime@runtime_package_version. When set, CodeBuild verifies the registry tarball integrity before building the image."
248
+ type = string
249
+ default = null
250
+ nullable = true
251
+
252
+ validation {
253
+ condition = var.runtime_package_integrity == null || can(regex("^sha512-[A-Za-z0-9+/=]+$", var.runtime_package_integrity))
254
+ error_message = "runtime_package_integrity must be null or an npm sha512 integrity string."
255
+ }
256
+ }
257
+
212
258
  variable "certificate_arn" {
213
- description = "ACM certificate ARN for ALB HTTPS mode. Leave null when protected_access_mode is cloudfront_default_domain."
259
+ description = "ACM certificate ARN for ALB HTTPS mode or CloudFront HTTPS-origin mode. Leave null only when the ALB is not serving HTTPS."
214
260
  type = string
215
261
  default = null
216
262
 
@@ -220,8 +266,11 @@ variable "certificate_arn" {
220
266
  }
221
267
 
222
268
  validation {
223
- condition = var.protected_access_mode != "alb_https_cert" || var.certificate_arn != null
224
- error_message = "certificate_arn is required when protected_access_mode is alb_https_cert."
269
+ condition = (
270
+ !(var.protected_access_mode == "alb_https_cert" || (var.protected_access_mode == "cloudfront_default_domain" && var.cloudfront_origin_protocol_policy == "https-only"))
271
+ || var.certificate_arn != null
272
+ )
273
+ error_message = "certificate_arn is required when protected_access_mode is alb_https_cert or CloudFront HTTPS origin is enabled."
225
274
  }
226
275
  }
227
276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/uptime",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
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",
@@ -26,6 +26,7 @@
26
26
  "Dockerfile",
27
27
  "Dockerfile.package",
28
28
  ".dockerignore",
29
+ "bun.lock",
29
30
  "infra/aws/README.md",
30
31
  "infra/aws/.terraform.lock.hcl",
31
32
  "infra/aws/*.tf",