toga-ai 1.0.550 → 1.0.551
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.
|
@@ -6,7 +6,7 @@ project: Worker
|
|
|
6
6
|
client: shared
|
|
7
7
|
type: feature
|
|
8
8
|
status: active
|
|
9
|
-
updated: 2026-08-
|
|
9
|
+
updated: 2026-08-11
|
|
10
10
|
owners: [jcardinal]
|
|
11
11
|
files:
|
|
12
12
|
- worker2/Component/Aws/Workloads/Workloads.php
|
|
@@ -88,20 +88,49 @@ it**.
|
|
|
88
88
|
|
|
89
89
|
## First consumer — ElasticBeanstalkHealth (worked example)
|
|
90
90
|
|
|
91
|
-
`_Worker_Infrastructure_CloudWatch::ElasticBeanstalkHealth(awsAccountId,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
|
|
91
|
+
`_Worker_Infrastructure_CloudWatch::ElasticBeanstalkHealth(string $awsAccountId,
|
|
92
|
+
array $environments, string $oneuptimeUrl)` is a **parameterized cron** (args spread from
|
|
93
|
+
`Core.CronJobs.parameters` as named args) that reads each EB environment's overall health
|
|
94
|
+
through `_Component_Aws_Workloads`, maps `HealthStatus` `Degraded`/`Severe` →
|
|
95
|
+
`alarm:"HIGH"`, and pushes a **non-fatal** OneUptime heartbeat (`setLogging(false)`,
|
|
96
|
+
`setThrowExceptionsOnFailure(false)` — the Compass push pattern; see
|
|
97
97
|
[OneUptime worker2 monitoring](./oneuptime-worker2-monitoring.md)).
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
**One monitor spans multiple regions in one account.** `$environments` is a **map of
|
|
100
|
+
region → environment names** (each value an array or a comma-separated string), so a single
|
|
101
|
+
monitor can watch EB environments across different regions of the same AWS account. The old
|
|
102
|
+
flat `elasticBeanstalkEnvironmentNames` list plus a single scalar `region` argument (and the
|
|
103
|
+
`HEALTH_DEFAULT_REGION` constant) are removed — with a scalar region every environment in a
|
|
104
|
+
monitor had to share a region. The cron `parameters` JSON therefore replaces the
|
|
105
|
+
`elasticBeanstalkEnvironmentNames` + `region` keys with a single `environments` object
|
|
106
|
+
(parameters are spread as **named** args, so the JSON key must match the parameter name):
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"awsAccountId": "654654170868",
|
|
111
|
+
"environments": {
|
|
112
|
+
"us-east-1": ["env-a"],
|
|
113
|
+
"us-west-2": ["env-b"],
|
|
114
|
+
"eu-west-1": ["env-c"]
|
|
115
|
+
},
|
|
116
|
+
"oneuptimeUrl": "<push URL — credential, not stored here>"
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Credential-reuse pattern (assume once, reuse across regions):** the method calls
|
|
121
|
+
`_Component_Aws_Workloads::assumeCredentials($awsAccountId)` **once** (STS creds are
|
|
122
|
+
region-agnostic) and then constructs **one `ElasticBeanstalkClient` per region reusing those
|
|
123
|
+
same credentials** — rather than calling the per-region `client()` helper repeatedly. Prefer
|
|
124
|
+
this shape whenever one cron touches several regions of a single account: one assume-role
|
|
125
|
+
round-trip, N clients. The OneUptime payload now carries a per-environment `region` field
|
|
126
|
+
plus a top-level `regions[]` array, and the WorkerJobs summary uses `name@region=status`.
|
|
127
|
+
|
|
128
|
+
The helper adoption was captured earlier: the prior inline STS/credential code and the
|
|
129
|
+
`HEALTH_ASSUME_ROLE_NAME` / `HEALTH_ASSUME_ROLE_SESSION` constants were removed in favor of
|
|
130
|
+
`_Component_Aws_Workloads` + the `[cloud]` config keys. The prior `CheckBeanstalks()` action
|
|
131
|
+
was renamed `ElasticBeanstalkInstances()` (dbchanges2 `Core/2026-08-10c` updates the CronJobs
|
|
132
|
+
action name; `Core/2026-08-10d` seeds the parameterized `ElasticBeanstalkHealth` cron row,
|
|
133
|
+
`isActive=0`, and now carries the `environments`-map sample parameters).
|
|
105
134
|
|
|
106
135
|
## Legacy static key — being retired
|
|
107
136
|
|
|
@@ -126,6 +155,14 @@ their only home.
|
|
|
126
155
|
explicitly in prod ini to override.
|
|
127
156
|
|
|
128
157
|
## Change history
|
|
158
|
+
- 2026-08-11 — `ElasticBeanstalkHealth` signature changed to
|
|
159
|
+
`(string $awsAccountId, array $environments, string $oneuptimeUrl)`: `$environments` is a
|
|
160
|
+
region → env-names map, so one monitor can watch EB environments across multiple regions
|
|
161
|
+
of one account. Removed the flat `elasticBeanstalkEnvironmentNames` list, the scalar
|
|
162
|
+
`region` arg, and the `HEALTH_DEFAULT_REGION` constant; cron `parameters` JSON now uses a
|
|
163
|
+
single `environments` object. Recorded the assume-once/reuse-credentials-across-regions
|
|
164
|
+
pattern (one `assumeCredentials()`, one `ElasticBeanstalkClient` per region) and the new
|
|
165
|
+
per-environment `region` + top-level `regions[]` payload fields. (jcardinal)
|
|
129
166
|
- 2026-08-10 — Created. Added `_Component_Aws_Workloads` as the standard cross-account AWS
|
|
130
167
|
access helper (instance-role → per-account `WorkloadsRuntime` STS assume-role), documented
|
|
131
168
|
the three-account role model and `[cloud]` config keys, and recorded that the legacy static
|
package/package.json
CHANGED