Files
floci/docs
Priamo Germosen 94fcf5cbf3 fix(lambda): hold the subnets a function's VpcConfig names (#8609)
On AWS a function's Hyperplane network interfaces sit in the subnets
its VpcConfig names, and EC2 refuses DeleteSubnet, and so DeleteVpc,
while one is there. Floci's Lambda never told EC2 a function used a
subnet, so DeleteSubnet succeeded under a VPC-configured function and
left it naming a subnet that was gone.

- LambdaService is a VpcDependencyProvider: a function of the caller's
  account, or a published version of one, holds each subnet its
  VpcConfig names and the VPC it is configured in
  (LambdaFunctionStore.listWithVersionsForAccount, which also reads a
  record stored before accounts were kept apart, unprefixed until it
  is next read).
- CreateFunction and UpdateFunctionConfiguration save a function that
  names subnets under EC2's subnet lock, so a DeleteSubnet either sees
  it or runs before it is stored. A VpcConfig the request set is
  resolved again under the lock, so a subnet deleted since the request
  was validated is unknown, as one never created is, and the function
  infers no VPC from it.

ECS awsvpc tasks already hold their subnet through the network
interface each task is given, which DeleteSubnet counts.

LambdaVpcResourceValidationIntegrationTest has DeleteSubnet refused
under a function, then under its published version once $LATEST moves
to another subnet, and allowed once the version is deleted, and a
subnet deleted while a function is created leaves it no inferred VPC.
LambdaFunctionStoreAccountScopeTest covers the unprefixed record.
ec2.md and lambda.md say so.
2026-11-16 15:04:43 -04:00
..
2026-03-15 17:43:56 -05:00