Skip to content

fix(aws-lambda-web-functions): package the AWS SDK, warn on new-endpoint throttling, use OAC - #484

Merged
anasstahr merged 2 commits into
mainfrom
feat/web-functions-sdk-loadtest-oac
Oct 22, 2026
Merged

anasstahr merged 2 commits into
mainfrom
feat/web-functions-sdk-loadtest-oac

Conversation

@rr-on-gh

@rr-on-gh rr-on-gh commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Three edits to aws-lambda-web-functions (version 1 → 2)

The AWS SDK is not in the Web Functions runtime. An app that imports @aws-sdk/* without
packaging it fails at startup, so every request 502s. The skill now says to package the SDK clients
like any other dependency, keep them in dependencies, and not mark them external. Files:
SKILL.md (anti-pattern row), deployment.md, architecture-patterns.md, migration.md,
troubleshooting.md.

A new endpoint's per-environment concurrency limit starts low and learns. Setting a low
maxEnvironments on a fresh endpoint causes 429 Platform.EndpointMaxEnvThrottle on early bursts
and load tests. scaling-and-concurrency.md gains a section saying not to set maxEnvironments
unless a cap is asked for, and to warn about early throttling when it is. The limit also restarts
for a new endpoint added to an already-warmed function, but not for a new revision on a warmed
endpoint. Files: scaling-and-concurrency.md, SKILL.md, troubleshooting.md.

CloudFront origins should use OAC, not a shared secret header. Replaces the shared-secret advice
with the documented setup: an IamAuth endpoint, an origin access control with origin type lambda
and signing behavior always-amz-auth, and a resource-based policy granting
cloudfront.amazonaws.com lambda:InvokeWebFunctionEndpoint scoped with aws:SourceArn. Files:
domains-and-routing.md, infrastructure-as-code.md, iam-and-security.md, troubleshooting.md,
SKILL.md.

The frontmatter description now excludes Python frameworks by name — "non-Node.js runtimes or
frameworks such as Flask or Django" — so a Flask VPC query no longer matches this skill.

Files changed

skills/specialized-skills/serverless-skills/aws-lambda-web-functions/   9 files, +144 / -15

Verification

  • mise run lint:md — 0 errors
  • python3 tools/validate.py — passes
  • python3 tools/sync-plugin-skills.py --check — passes
  • uv run python tools/validate_spec.py — Agent Plugins v1.0.0 conformance passes
  • gitleaks detect — no leaks
  • The CloudFormation and CDK snippets were deployed end to end in us-east-1: a direct unsigned
    request returns 403, GET and POST through CloudFront return 200, and removing the resource policy
    or pointing aws:SourceArn at a different distribution returns 403 again. Stacks deleted after.
  • The concurrency learning behaviour was measured live on two new functions with identical code,
    one capped at maxEnvironments: 2 and one uncapped, under 40 concurrent requests.
  • Text-only (no executable code)
  • Tested with: Claude Code and Kiro

Type of Change

  • New plugin
  • New skill
  • Bug fix
  • Documentation update
  • CI/CD change
  • Other

Checklist

  • I have read the CONTRIBUTING guide
  • My changes pass python3 tools/validate.py
  • I have updated relevant documentation

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…int throttling, use OAC

Three corrections, each from a reported failure mode (version 1 -> 2).

- The Web Functions runtime does not include the AWS SDK. An app importing
  @aws-sdk/* without packaging it fails at startup and every request 502s.
  Package the clients like any other dependency, keep them in dependencies,
  and do not mark them external. SKILL.md, deployment.md,
  architecture-patterns.md, migration.md, troubleshooting.md.
- A new endpoint's per-environment concurrency limit starts low and learns, so
  a low maxEnvironments throttles early bursts and load tests with
  429 Platform.EndpointMaxEnvThrottle. Do not set maxEnvironments unless a cap
  is requested, and warn when one is. The limit also restarts for a new
  endpoint on a warmed function, but not for a new revision on a warmed
  endpoint. scaling-and-concurrency.md, SKILL.md, troubleshooting.md.
- Protect a CloudFront origin with OAC rather than a shared secret header: an
  IamAuth endpoint, an origin access control with origin type lambda and
  always-amz-auth signing, and a resource policy granting
  cloudfront.amazonaws.com lambda:InvokeWebFunctionEndpoint scoped with
  aws:SourceArn. domains-and-routing.md, infrastructure-as-code.md,
  iam-and-security.md, troubleshooting.md, SKILL.md.

The description now excludes Python frameworks by name, so a Flask query no
longer matches this skill.
@rr-on-gh
rr-on-gh requested a review from a team as a code owner October 22, 2026 10:51
@anasstahr
anasstahr enabled auto-merge October 22, 2026 13:18
@anasstahr
anasstahr added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 85b5e04 Oct 22, 2026
10 checks passed
@anasstahr
anasstahr deleted the feat/web-functions-sdk-loadtest-oac branch October 22, 2026 13:21
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.

2 participants