Skip to content

Commit f60c3b9

Browse files
author
Samphire Reeve
committed
Updates from pr comments
1 parent cad4fd5 commit f60c3b9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ Run `sls deploy`, the defined Stepfunctions are deployed.
981981

982982
## IAM Role
983983

984-
The IAM roles required to run Statemachine are automatically generated for the state machines lambda, with the policy name of `StatesExecutionPolicy-<environment>`. This is given the default permissions of allowing the lambda InvokeFunction. You can also specify a custom ARN directly to the step functions lambda.
984+
The IAM roles required to run Statemachine are automatically generated for each state machine in the `serverless.yml`, with the IAM role name of `StatesExecutionPolicy-<environment>`. These roles are tailored to the services that the state machine integrates with, for example with Lambda the `InvokeFunction` is applied. You can also specify a custom ARN directly to the step functions lambda.
985985

986986
Here's an example:
987987

@@ -993,9 +993,9 @@ stepFunctions:
993993
definition:
994994
```
995995

996-
It is also possible to use the [CloudFormation intrinsic functions](https://docs.aws.amazon.com/en_en/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html) to reference resources from elsewhere. This allows for an IAM Role to be created and applied to the step function all within the serverless file.
996+
It is also possible to use the [CloudFormation intrinsic functions](https://docs.aws.amazon.com/en_en/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html) to reference resources from elsewhere. This allows for an IAM role to be created, and applied to the state machines all within the serverless file.
997997

998-
The below example shows the policy needed if your step function needs the ability to send a message to an sqs queue. To apply the role either the RoleName can be used as a reference in the state machine, or the role ARN can be used like in the example above. It is important to note that if lambda roles are stored in a folder, this must be specified on the `Path` property on the new role.
998+
The below example shows the policy needed if your step function needs the ability to send a message to an sqs queue. To apply the role either the RoleName can be used as a reference in the state machine, or the role ARN can be used like in the example above. It is important to note that if you want to store your state machine role at a certain path, this must be specified on the `Path` property on the new role.
999999

10001000
```yml
10011001
stepFunctions:
@@ -1012,7 +1012,7 @@ resources:
10121012
Type: AWS::IAM::Role
10131013
Properties:
10141014
RoleName: RoleName
1015-
Path: /path_to_lambda_roles/
1015+
Path: /path_of_state_machine_roles/
10161016
AssumeRolePolicyDocument:
10171017
Statement:
10181018
- Effect: Allow
@@ -1029,7 +1029,8 @@ resources:
10291029
- Effect: Allow
10301030
Action:
10311031
- lambda:InvokeFunction
1032-
Resource: "*"
1032+
Resource:
1033+
- arn:aws:lambda:lambdaName
10331034
- Effect: Allow
10341035
Action:
10351036
- sqs:SendMessage

0 commit comments

Comments
 (0)