I have a problem creating a StepFunction StateMach...
# aws
h
I have a problem creating a StepFunction StateMachine using the aws-native plugin. I have two stacks, one of which is a test Stack, with the following code:
Copy code
stepfunctions.StateMachine(
    f"{function_name}StateMachine",
    state_machine_name=f"{function_name}-StateMachine",
    state_machine_type=stepfunctions.StateMachineType.STANDARD,
    definition_string=json.dumps(step_function_machine_json),
    role_arn=execution_role
)
This creation works fine. But my other production Stack code is as follows:
Copy code
stepfunctions.StateMachine(
    f"{function_name}StateMachine",
    state_machine_name=f"{function_name}-StateMachine",
    state_machine_type=stepfunctions.StateMachineType.STANDARD,
    definition_string=json.dumps(step_function_machine_json),
    role_arn=self.params["execution_role"]
)
When using production deployment, an error will be reported: “NameError: name ’StateMachineDefinitionArgs ’is not defined” , which one has encountered this problem, can you help me solve it? Thank you very much.
s
Is there a particular reason you're using the AWS Native provider instead of AWS provider?
h
oh, sorry,I just found out that the AWS provider has a call to stepfunction, which is abbreviated as sfn. I will try to see if the AWS provider can be created successfully.