feat(cloudformation): provision AWS::StepFunctions::StateMachine#1152
Open
walker-luke wants to merge 1 commit into
Open
feat(cloudformation): provision AWS::StepFunctions::StateMachine#1152walker-luke wants to merge 1 commit into
walker-luke wants to merge 1 commit into
Conversation
CloudFormationResourceProvisioner previously had no case for
AWS::StepFunctions::StateMachine, so stacks containing one fell through
to the default branch that stubs a placeholder ARN and reports
CREATE_COMPLETE without invoking StepFunctionsService. Downstream
EventBridge Pipes that target the state machine then fail at runtime
with "State machine does not exist".
Add a provisioner that:
- Resolves StateMachineName (auto-generating from logical id when absent)
- Resolves DefinitionString and applies DefinitionSubstitutions
(the same ${Var} replacement CloudFormation performs server-side)
- Resolves RoleArn, StateMachineType, and Tags
- Delegates to the existing StepFunctionsService.createStateMachine
- Sets PhysicalId to the canonical ARN (matching AWS Ref semantics)
and exposes the Arn and Name attributes for Fn::GetAtt
Also wire deletion through StepFunctionsService.deleteStateMachine.
Adds an integration test that creates a stack with substitutions,
asserts the resolved definition is stored, asserts CFN outputs return
the canonical ARN and name, and asserts deletion removes the resource.
hectorvent
requested changes
Jun 4, 2026
Collaborator
hectorvent
left a comment
There was a problem hiding this comment.
Hi @walker-luke,
Thanks for the PR. It is a solid fix.
Please take a look at the conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CloudFormationResourceProvisionerhas handlers for ~30 resource types but no case forAWS::StepFunctions::StateMachine. Templates containing one currently fall through to the default branch inprovision(...), which stubs a placeholder physical id, setsArntoarn:aws:stub:::<logical-id>, and reportsCREATE_COMPLETEwithout ever callingStepFunctionsService.The state machine therefore does not exist in the SFN store after a stack create. Downstream resources that depend on it (e.g.
AWS::Pipes::Pipewith a Step Functions target) deploy successfully but fail at runtime withState machine does not exist (AwsException)the first time the pipe tries to invoke its target.Change
Add a provisioner that delegates to the existing
StepFunctionsService.createStateMachine:StateMachineName(auto-generates from logical id when absent, matching the Pipe/Lambda pattern).DefinitionStringand appliesDefinitionSubstitutions- the same${Var}replacement CloudFormation performs server-side before handing the definition to Step Functions.RoleArn,StateMachineType, andTags(via the existingparseCfnTagshelper).PhysicalIdto the canonical ARN (matching real AWSRefsemantics) and exposesArn+Nameattributes forFn::GetAtt.Wires deletion through
StepFunctionsService.deleteStateMachine.Test plan
Adds
CloudFormationIntegrationTest#createStack_stepFunctionsStateMachineResolvesDefinitionSubstitutionsAndIsDeletable, which:AWS::StepFunctions::StateMachinewith aDefinitionSubstitutionsmap referencing `{Marker}`.DescribeStateMachinereturns the canonical ARN, the resolved role, and a definition where${Marker}has been replaced (and no placeholder remains).Outputsexpose the canonical ARN viaRefand the name viaFn::GetAtt.DescribeStateMachinethen returnsStateMachineDoesNotExist.Verified locally:
./mvnw test -Dtest=CloudFormationIntegrationTest- 77/77 pass./mvnw test -Dtest='StepFunctions*Test'- 68/68 passNotes
StepFunctionsService, the SFN wire protocol, or any other resource handler.LoggingConfigurationandTracingConfigurationproperties are accepted on the input but not persisted, matching how other Floci provisioners treat operationally‑irrelevant emulator properties today.