So I am trying to invoke a simple step function I wrote using a Lambda in python. I am using boto3 for this purpose
client = boto3.client('stepfunctions')
response = client.start_execution(
stateMachineArn='aws:states:.......',
name='dev-yuvi-pipeline-sf',
input= json.dumps(returnVal)
)
And I have created an IAM Role which has "AWSStepFunctionsFullAccess" policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "states:*",
"Resource": "*"
}
]
}
I assign this role to my Lambda, but when I run the lambda I get the following error
An error occurred (AccessDeniedException) when calling the StartExecution operation: User: arn:aws:sts::xxxxxxxx:assumed-role/dev-yuvi-role1/dev-yuvi-pipeline-lambda is not authorized to access this resource: ClientError
dev-yuvi-pipeline-lambda is my Lambda's name and dev-yuvi-role1 is my role name
Can someone help me out here, what am I doing wrong, why can't I invoke the step function from Lambda as I have given it the permissions it needs