Skip to content

ref(aws-lambda): Catch potential exceptions when publishing AWS Lambda layers to new regions#178

Merged
iker-barriocanal merged 4 commits into
masterfrom
aws-lambda-layer-python
Feb 11, 2021
Merged

ref(aws-lambda): Catch potential exceptions when publishing AWS Lambda layers to new regions#178
iker-barriocanal merged 4 commits into
masterfrom
aws-lambda-layer-python

Conversation

@iker-barriocanal

Copy link
Copy Markdown
Contributor

AWS regions are requested using the EC2 client, and Lambda layers are published to these regions using the Lambda client. However, it may be possible that an exception is raised (such as a timeout exception). With this PR these exceptions are catched and warned, without stopping Craft. Note that even if there's an exception, layers may be created.

@iker-barriocanal iker-barriocanal changed the title ref: Catch potential exceptions when publishing AWS Lambda layers to new regions ref(aws-lambda): Catch potential exceptions when publishing AWS Lambda layers to new regions Feb 11, 2021
@iker-barriocanal
iker-barriocanal enabled auto-merge (squash) February 11, 2021 11:45
@iker-barriocanal
iker-barriocanal merged commit 47d1e2e into master Feb 11, 2021
@iker-barriocanal
iker-barriocanal deleted the aws-lambda-layer-python branch February 11, 2021 11:50
return await Promise.all(
this.awsRegions.map(region => {
return this.publishLayerToRegion(region);
const publishedLayers = await Promise.all(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is Promise.allSettled beginning from Node 12.9.

This block would be much easier to follow (and more efficient) with the following code:

const = publishedLayers = await Promise.all(
  this.awsRegions.map(
    async region => this.publishLayerToRegion(region).catch(error => logger.warn(`Something went wrong when publishing to AWS region ${region}: ${error.message}`))
  )
);

Comment on lines +118 to +120
return publishedLayers.filter(layer => {
return layer !== undefined;
}) as PublishedLayer[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better as return publishedLayers.filter(Boolean);

BYK added a commit that referenced this pull request Jun 23, 2026
## Summary

Resolves **10 open Dependabot alerts** across 5 CVEs and dismisses 2
low-severity esbuild alerts as tolerable risk.

### Alerts Fixed

| Alert(s) | Package | Severity | CVE | Fix |
|----------|---------|----------|-----|-----|
| #180, #181 | `tar` | Medium | GHSA-vmf3-w455-68vh | Bump direct pin
`7.5.11` -> `7.5.16` |
| #178, #179 | `form-data` | High | GHSA-hmw2-7cc7-3qxx |
`pnpm.overrides` for `4.0.6` (v4) and `2.5.6` (v2) |
| #172, #176 | `vite` (root) | High + Medium | GHSA-fx2h-pf6j-xcff,
GHSA-v6wh-96g9-6wx3 | Add as direct devDep `^7.3.5` + override |
| #173, #177 | `vite` (docs) | High + Medium | same | `pnpm.overrides`
in docs |
| #174, #175 | `astro` | High + Medium | GHSA-2pvr-wf23-7pc7,
GHSA-jrpj-wcv7-9fh9 | `pnpm update` -> `6.4.8` |

### Alerts Dismissed (tolerable_risk)

| Alert(s) | Package | Severity | Reason |
|----------|---------|----------|--------|
| #167, #168 | `esbuild` | Low | GHSA-g7r4-m6w7-qqqr - Windows
dev-server only vulnerability. Craft is a CLI tool, docs is a static
site. Transitive dep of `[email protected]` which pins `esbuild@^0.27.0` -
cannot fix without vite 8 major bump. |

## Changes

### Root project (`package.json`)
- `tar`: `7.5.11` -> `7.5.16` (direct pin bump)
- `vite`: added as devDependency at `^7.3.5` (was only transitive via
vitest)
- `pnpm.overrides`: added `form-data@>=4: ^4.0.6`, `form-data@<3:
^2.5.6`, `vite: ^7.3.5`

### Docs project (`docs/package.json`)
- `astro`: resolved `5.16.11` -> `6.4.8` (specifier `^6.1.10` allowed
it)
- `@astrojs/starlight`: resolved `0.37.3` -> `0.38.3`
- `pnpm.overrides`: added `vite: ^7.3.5`

## Verification

- `pnpm build` - passed
- `pnpm test` - 1025 passed, 1 skipped
- `pnpm lint` - 0 errors
- `pnpm docs:build` - 27 pages built successfully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants