Search code examples
amazon-web-servicesterraformaws-step-functions

What is the AWS Service Principal value for stepfunction?


I'm writing the terraform for creating an IAM role for AWS StepFunctions. What should be the value for Principal in assume_role_policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "stepfunctions.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}

I'm getting the error

Error: Error creating IAM Role my_utility_sfn: MalformedPolicyDocument: Invalid principal in policy: "SERVICE":"stepfunctions.amazonaws.com"


Solution

  • The AWS documentation for service endpoints should hold the answer.

    Looks like it is states.<region>.amazonaws.com