Skip to content

Commit cad4fd5

Browse files
author
Samphire Reeve
committed
Refactored
1 parent fb11dfc commit cad4fd5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +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 lambda InvokeFunction.
985-
986-
However, it is also possible to specify ARN directly.
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.
987985

988986
Here's an example:
989987

@@ -995,10 +993,9 @@ stepFunctions:
995993
definition:
996994
```
997995

998-
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 another IAM Role to be created and
999-
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.
1000997

1001-
Example:
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.
1002999

10031000
```yml
10041001
stepFunctions:
@@ -1014,8 +1011,8 @@ resources:
10141011
StateMachineRole:
10151012
Type: AWS::IAM::Role
10161013
Properties:
1017-
RoleName: role
1018-
Path: /lambda_roles/
1014+
RoleName: RoleName
1015+
Path: /path_to_lambda_roles/
10191016
AssumeRolePolicyDocument:
10201017
Statement:
10211018
- Effect: Allow

0 commit comments

Comments
 (0)