Commit 1cbae34
authored
Move self-monitoring layers and private images to serverless-testing (093468662994) (#1183)
## Overview
Move both self-monitoring **layers** and **container images** from the
sandbox account (`425362996713`) to the serverless-testing account
(`093468662994`), where the LOD/LMI self-monitoring runtimes live.
Eliminates cross-account ECR pulls during CDK Docker builds *and* the
cross-account Lambda layer query in the image build script.
After this PR, the self-monitoring test artifacts are entirely
self-contained in `093468662994`. The regular `publish layer sandbox`
and `publish layer prod` jobs are untouched.
### Changes
- **`environments.yaml`**: add `serverless_testing` environment for
`093468662994` (assumes role `layer-deployer`, externalId
`serverless-testing-publish-externalid`, mirrors
`automatically_bump_version: 1` / `add_layer_version_permissions: 0`
from sandbox)
- **`pipeline.yaml.tpl`** — two job changes:
- `publish private images`: switch from `sandbox` env →
`serverless_testing` env (push to new ECR)
- `publish layer [self-monitoring]`: switch from `sandbox` env →
`serverless_testing` env (publish Datadog-Extension layer to
`093468662994` in us-east-1 + us-west-2)
- **`build_private_image.sh`**:
- Push to
`093468662994.dkr.ecr.us-east-1.amazonaws.com/datadog-lambda-extension`
(parameterizable via `PRIVATE_IMAGE_ECR_ACCOUNT` /
`PRIVATE_IMAGE_ECR_REPO`)
- Drop the cross-account `arn:aws:lambda:us-east-1:425362996713:layer:…`
lookup. Query the same account we publish to — works because `publish
layer [self-monitoring]` now lives in that account too.
### Prerequisites
- ECR repo `datadog-lambda-extension` in `093468662994` — created by
[`serverless-self-monitoring#637`](DataDog/serverless-self-monitoring#637)
(LVU CDK), already deployed manually
- IAM role `layer-deployer` in `093468662994` with Lambda layer publish
+ ECR push perms — created by
[`cloud-inventory#59058`](DataDog/cloud-inventory#59058),
already merged
- Vault key `serverless-testing-publish-externalid` at
`kv/k8s/gitlab-runner/datadog-lambda-extension/secrets` — created
manually
### Knock-on for serverless-self-monitoring
Layer-version-updater (`latest-dev.json`) currently pins
`Datadog-Extension` to
`arn:aws:lambda:us-east-1:425362996713:layer:Datadog-Extension:…`. After
this PR's first run, the next "self-monitoring" extension layer is
published to `093468662994` instead — LVU will need to learn to query
`093468662994` for the Datadog-Extension dev layer. Tracked as a
follow-up; safe because the existing `425362996713` layers don't
disappear, they just stop receiving new versions from the
`[self-monitoring]` job.
## Testing
- [ ] Generated pipeline YAML has `serverless_testing` environment for
both `publish private images` and `publish layer [self-monitoring]`
- [ ] Trigger manual `publish layer [self-monitoring]` on a test
pipeline → confirm Datadog-Extension layer published in `093468662994`
(us-east-1, us-west-2)
- [ ] Trigger manual `publish private images` on the same pipeline →
confirm image pushed to
`093468662994/datadog-lambda-extension:<VERSION>` with version matching
the layer just published
- [ ] Verify LOD/LMI can pull from `093468662994` ECR during CDK deploy1 parent 2bea5ba commit 1cbae34
4 files changed
Lines changed: 44 additions & 17 deletions
File tree
- .gitlab
- datasources
- scripts
- templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
8 | 17 | | |
9 | 18 | | |
10 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
15 | | - | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
42 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
210 | | - | |
211 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
212 | 227 | | |
213 | 228 | | |
214 | 229 | | |
215 | 230 | | |
216 | | - | |
217 | 231 | | |
218 | 232 | | |
219 | 233 | | |
220 | 234 | | |
221 | | - | |
222 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
223 | 239 | | |
224 | | - | |
225 | | - | |
| 240 | + | |
226 | 241 | | |
227 | 242 | | |
228 | 243 | | |
| |||
322 | 337 | | |
323 | 338 | | |
324 | 339 | | |
325 | | - | |
| 340 | + | |
326 | 341 | | |
327 | 342 | | |
328 | 343 | | |
| |||
0 commit comments