From 5e3cf78957ab62c795b3a5c84e6367aa6150b314 Mon Sep 17 00:00:00 2001 From: Peter Beckham Date: Mon, 24 Aug 2026 12:55:18 +0100 Subject: [PATCH] Install uv so callers can package python Lambdas terraform-server's queue sampler (kosli-dev/server#6561) is a python Lambda whose dependencies are declared in a pyproject.toml with a committed uv.lock. terraform-aws-modules/lambda/aws builds that package by shelling out to `uv export --no-dev --frozen` and `uv pip install --python python3.13 --system --target .` from the local-exec provisioner on `null_resource.archive`, so the tooling has to exist on this runner or the apply cannot produce a zip. Plans are unaffected either way: the module's prepare stage hashes pyproject.toml and uv.lock without running a resolver, which is why the absence only shows up at apply. And because the caller commits uv.lock, package.py skips its own "uv must be installed and available in PATH" branch and goes straight to check_call, so the failure surfaces as a bare FileNotFoundError from a provisioner rather than as advice. The step is unconditional rather than an input. It costs a couple of seconds on runs that do not need it, and threading a boolean through plan.yml, apply.yml and detect-drift.yml to save that would spread one caller's packaging choice across four files. uv's own version is deliberately unpinned while the action is SHA pinned. What ends up in a deployment package is decided by the caller's uv.lock and the hashes recorded in it, so a newer resolver reading the same frozen lock produces the same bytes. Pinning it here would add a bump chore to a workflow shared by every terraform repository. Co-Authored-By: Claude Opus 5 --- .github/workflows/base.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 290eeaf..07e5a8b 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -121,6 +121,11 @@ jobs: path: .tf-cli - run: echo "$GITHUB_WORKSPACE/.tf-cli/bin" >> "$GITHUB_PATH" + - name: Install uv + # Callers that package a python Lambda build it with `uv export` and + # `uv pip install`, run by terraform-aws-modules/lambda/aws during apply. + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + - name: Check formatting working-directory: ${{ inputs.working_directory }} run: terraform fmt --recursive -check