fix(lambda): accept layer ARNs when deleting versions (#8409)

* fix(lambda): accept layer ARNs when deleting versions
* test(lambda): share layer publication cleanup
* test(iam): include layer deletion in the resource inventory
* fix(lambda): read Lambda's IAM resources whole from the generated table
This commit is contained in:
Jackson Price authored and GitHub committed 2026-11-15 01:56:37 -04:00
1 parent ce25aa0247
commit b8014cbd4e
22 files changed
+1219 -906

No files matched your search

+14 -6
View File
@@ -116,15 +116,18 @@ part in authorizing calls to the function:
- Provisioned-concurrency configuration operations also act in the account named by the function
reference. Cross-account access requires that function's policy to allow the caller.
- Other operations act on the caller's own function of the name the ARN gives, whatever account
the ARN names, and are authorized against that function. Floci does not serve them on another
account's function, which AWS allows through a function policy.
the ARN names, and are authorized against both the function the ARN names and the caller's own
function of that name. Floci does not serve them on another account's function, which AWS allows
through a function policy.
- Within one account, a statement naming the caller grants on its own. One naming only the
account, as `AddPermission --principal <account-id>` writes it, delegates to the account, so the
caller's identity policy has to allow the call too.
- An invoke or provisioned-concurrency configuration operation is authorized against the version or
alias it names, in the function name or in `Qualifier`. A grant added with `Qualifier` covers that
version or alias only, and a grant on the function does not cover a qualified operation.
Other operations are authorized against the unqualified function.
- A version or alias written into the function name is part of the function an operation is
authorized against, so a grant added with `Qualifier` covers a call naming that version or alias,
and a grant on the function does not. `Qualifier` itself names a version or alias only for the
provisioned-concurrency configuration operations, which act on it; every other operation is
authorized against the function as its name gives it, as the Service Reference lists the function
alone for those actions.
- A statement conditioned on `InvokedViaFunctionUrl` does not admit a direct `Invoke`.
- `aws:PrincipalOrgID` is not part of the request context, so a grant added with `PrincipalOrgID`
admits no caller.
@@ -519,6 +522,11 @@ validate each `Layers` ARN in the caller's own account eagerly against that stor
real AWS - an unresolvable one is rejected with `InvalidParameterValueException: Layer version
... does not exist.`, not silently accepted.
`DeleteLayerVersion` accepts either a layer name or an unversioned layer ARN, with
`VersionNumber` supplied separately. ARN deletion resolves the stored version in the ARN's
region and removes its archive. IAM checks use that same layer-version ARN; another
account's ARN cannot select a same-named layer in the caller's account.
An ARN naming another account or another partition is answered on the live service by the layer's
resource policy: an AWS-managed public layer resolves, and everything else is
`AccessDeniedException`. Measured on `CreateFunction` in ap-southeast-1, a foreign-account ARN and