ADR-0039: The mail forwarder uses the runtime's AWS SDK#

  • Status: accepted. Replaces ADR-0037's decision that the forwarder uses only the standard library; the rest of ADR-0037 stands.
  • Date: 2026-11-29

Context#

ADR-0037 decides on a standard-library forwarder. The DNSSEC probe is standard library because everything it does is DNS over HTTPS, which the standard library already does (ADR-0020). The forwarder is different: it calls two AWS APIs, S3 GetObject and SES SendRawEmail, and without the SDK each call has to be signed with Signature Version 4, written out by hand.

That is about ninety lines of authentication code. It can be tested against the example AWS publishes, but it is still code this project owns and AWS does not, and it has to keep matching the SDK on everything the SDK already handles: credential sources, endpoints, retries, error parsing.

Every Python runtime Lambda offers includes boto3, AWS's SDK. The runtime is already a dependency the project trusts without pinning: python3.13 takes AWS's patch releases as AWS ships them, and boto3 ships with it.

Decision#

  1. The forwarder calls S3 and SES through the boto3 the runtime provides. Nothing is packaged with it: the deployment package is still one file.
  2. The forwarder imports boto3 only when it creates its clients, which are passed in. Its tests use fakes in their place, so make test-mail stays standard library only and needs nothing installed.
  3. Everything else in ADR-0037 stands: the original is attached unparsed, nothing from it reaches the forward's headers, and a message failing the spam or virus scan is not forwarded.

Alternatives considered#

Signing by hand, as built first. Ninety lines of security-relevant code duplicating the vendor's own client, to avoid a dependency the runtime already carries. The independence it buys is from AWS, inside AWS's own runtime, which is no independence at all.

boto3 packaged with the function, pinned to a version and checksum. Principle 5's mechanism applied to a Lambda package. It adds a build step and about 20 MB of package to track, and the runtime's own copy would still be there underneath. Pinning matters most where the code comes from someone the project does not already trust; boto3 comes from the same party as the runtime and the account.

Pinning the runtime version (runtime_management_config). It pins boto3 with it, but it also stops the runtime's security patches, and the apply role holds no lambda:PutRuntimeManagementConfig.

Consequences#

Positive: the forwarder loses its signing code, its tests lose the signing cases, and what remains is the part ADR-0037 is about: what reaches the forward and what does not.

Negative:

  • boto3's version is whatever the runtime ships, and changes when AWS updates the runtime. A breaking change would show as the forwarder's error alarm, not as a failing check, and it is listed on the limitations page.
  • The tests check what the forwarder asks boto3 to do, not boto3 itself.

Neutral: the DNSSEC probe stays standard library, for ADR-0020's reasons. A future function that calls AWS APIs follows this decision rather than ADR-0037's.

Revisit when#

  • AWS stops including boto3 in the Python runtimes.
  • A runtime update breaks the forwarder: then package a pinned boto3.

Built 2026-12-01 from commit 5f3eb2c4b04f9d8367364b6f4598a05a364e2263. This page was generated from the same source that provisions the infrastructure it describes.