Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stepfunctions StateMachine Create Bug #1830

Open
SeanWei-lab opened this issue Nov 14, 2024 · 1 comment
Open

stepfunctions StateMachine Create Bug #1830

SeanWei-lab opened this issue Nov 14, 2024 · 1 comment
Labels
awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed

Comments

@SeanWei-lab
Copy link

What happened?

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:
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:
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"]
)
Error occurred when running production code: NameError: name 'StateMachineDefinitionArgs' is not defined

Because I tested that the stack is fine and the production stack has a problem, so I feel this is a bug.

Example

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"]
)

Output of pulumi about

CLI
Version 3.138.0
Go Version go1.23.2
Go Compiler gc

Plugins
KIND NAME VERSION
resource aws 6.49.1
resource aws-native 1.8.0
language python unknown

Host
OS darwin
Version 15.0.1
Arch arm64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@SeanWei-lab SeanWei-lab added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 14, 2024
@flostadler
Copy link
Contributor

flostadler commented Nov 15, 2024

Hey @SeanWei-lab, sorry you're running into issues here!

I don't seem to be able to reproduce this. I created this program based on your example and it's deploying successfully:

import pulumi_aws_native as aws_native
from pulumi_aws_native import stepfunctions

step_function_role = aws_native.iam.Role("stepFunctionRole",
    assume_role_policy_document="""{
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Service": "states.amazonaws.com"
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
    """
)

state_machine = aws_native.stepfunctions.StateMachine("myStateMachine",
    role_arn=step_function_role.arn,
    state_machine_type=stepfunctions.StateMachineType.STANDARD,
    definition_string="""
    {
      "Comment": "A simple AWS Step Functions state machine example",
      "StartAt": "HelloWorld",
      "States": {
        "HelloWorld": {
          "Type": "Pass",
          "Result": "Hello, World!",
          "End": true
        }
      }
    }
    """,
    state_machine_name="myStateMachine"
)

Given that the only difference between your test and prod stacks seems to be how you set the role_arn, I tried setting it to None in my test to see if that triggers that error. But this correctly errors with TypeError: Missing required property 'role_arn'.

Could you provide a full repro so we can further debug this? Thanks!

@flostadler flostadler added needs-repro Needs repro steps before it can be triaged or fixed awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed
Projects
None yet
Development

No branches or pull requests

2 participants