refactor(cloudformation): move CustomResource into CustomResourceCfnProvisioner (#4044)

Extracts AWS::CloudFormation::CustomResource and every Custom::* type out of the CloudFormationResourceProvisioner monolith into a dedicated CustomResourceCfnProvisioner, completing the per-service provisioner migration: every CloudFormation resource type now lives in a provisioner reached through the registry, and the monolith is a thin dispatcher (registry lookup plus the unsupported-type stub).

CloudFormationResourceRegistry.forType routes any otherwise-unmatched Custom:: type to the CustomResource provisioner, with an exact registry entry still winning so Custom::DynamoDBReplica stays on DynamoDbCfnProvisioner. With that, the monolith's provision switch serves no type, and its LEGACY_SWITCH_TYPES and DELETE_NEEDS_STACK_RESOURCE sets are now empty, kept as the guards their tests check. The now-dead lambdaService, iamService, customResourceResponseStore, and reachableEndpoint dependencies are dropped.

The readOnly Id attribute is recorded as a gap: it is the primary identifier returned by Ref (the physical resource id), not a separate Fn::GetAtt value Floci publishes.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-09-20 22:34:16 -04:00
1 parent 44fa114483
commit 4906b7deed
6 files changed
+303 -292

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.CustomResourceCfnProvisioner;
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;
@@ -252,6 +253,10 @@ final class CfnProvisionerFixture {
if (lambdaService != null) {
discovered.add(new LambdaCfnProvisioner(lambdaService, lambdaLayerService, s3Service, config));
}
if (customResourceResponseStore != null) {
discovered.add(new CustomResourceCfnProvisioner(lambdaService, objectMapper,
customResourceResponseStore, reachableEndpoint));
}
if (s3Service != null) {
discovered.add(new S3CfnProvisioner(s3Service));
}
@@ -705,11 +710,7 @@ final class CfnProvisionerFixture {
}
ensureDynamicReferences();
return new CloudFormationResourceProvisioner(
lambdaService,
iamService,
objectMapper,
customResourceResponseStore,
reachableEndpoint,
resourceRegistry,
dynamicReferences,
config);