refactor(cloudformation): move Lambda types into LambdaCfnProvisioner (#4032)

Extracts AWS::Lambda::Function and AWS::Lambda::LayerVersion out of the CloudFormationResourceProvisioner monolith into a dedicated LambdaCfnProvisioner, continuing the per-service provisioner migration. Behavior is preserved: create, in-place configuration and code update, replacement on a FunctionName or PackageType change, reserved concurrency, layer publication, and the legacy name-mode inference all move unchanged.

Moving AWS::Lambda::Function into the registry subjects it to the schema-coverage gate: its readOnly Arn is set as before, and SnapStartResponse is recorded as a gap since Floci does not emulate Lambda SnapStart. InlineZipPackager is made public so the extracted provisioner can reach it. The monolith's now-dead s3Service and lambdaLayerService dependencies are dropped; lambdaService stays for the custom-resource handler.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-09-20 17:51:33 -04:00
1 parent a0089b3548
commit 648ea26cc9
7 files changed
+880 -785

No files matched your search

@@ -65,6 +65,7 @@ import io.github.hectorvent.floci.services.cloudformation.provisioners.FirehoseC
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamAccessKeyCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamInstanceProfileCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamManagedPolicyCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.LambdaCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamPolicyCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamRoleCfnProvisioner;
import io.github.hectorvent.floci.services.cloudformation.provisioners.IamUserCfnProvisioner;
@@ -248,6 +249,9 @@ final class CfnProvisionerFixture {
if (stepFunctionsService != null) {
discovered.add(new StepFunctionsCfnProvisioner(stepFunctionsService, s3Service, objectMapper));
}
if (lambdaService != null) {
discovered.add(new LambdaCfnProvisioner(lambdaService, lambdaLayerService, s3Service, config));
}
if (s3Service != null) {
discovered.add(new S3CfnProvisioner(s3Service));
}
@@ -701,10 +705,8 @@ final class CfnProvisionerFixture {
}
ensureDynamicReferences();
return new CloudFormationResourceProvisioner(
s3Service,
lambdaService,
iamService,
lambdaLayerService,
objectMapper,
customResourceResponseStore,
reachableEndpoint,
@@ -3,6 +3,7 @@ package io.github.hectorvent.floci.services.cloudformation;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.hectorvent.floci.services.cloudformation.model.StackResource;
import io.github.hectorvent.floci.services.cloudformation.provisioners.LambdaCfnProvisioner;
import io.github.hectorvent.floci.services.lambda.LambdaService;
import io.github.hectorvent.floci.services.lambda.model.LambdaFunction;
import org.junit.jupiter.api.BeforeEach;
@@ -140,10 +141,10 @@ class CloudFormationLambdaLegacyNameModeTest {
"did not expect a warning for the unambiguous explicit-name case, got: " + messages);
}
/** Collects the messages CloudFormationResourceProvisioner logs while {@code action} runs. */
/** Collects the messages LambdaCfnProvisioner logs while {@code action} runs. */
private List<String> provisionerLogMessages(Runnable action) {
java.util.logging.Logger logger =
java.util.logging.Logger.getLogger(CloudFormationResourceProvisioner.class.getName());
java.util.logging.Logger.getLogger(LambdaCfnProvisioner.class.getName());
List<String> messages = new CopyOnWriteArrayList<>();
java.util.logging.Handler handler = new java.util.logging.Handler() {
@Override