Skip to content

Commit d006f82

Browse files
authored
Update README.md
1 parent b5cfbc3 commit d006f82

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,34 @@ stepFunctions:
125125
role: arn:aws:iam::xxxxxxxx:role/yourRole
126126
definition:
127127
```
128+
## Tips
129+
### How to specify the stateMachine ARN to environment variables
130+
Here is serverless.yml sample to specify the stateMachine ARN to environment variables.
131+
This makes it possible to trigger your statemachine through Lambda events
132+
133+
```yml
134+
functions:
135+
hello:
136+
handler: handler.hello
137+
hello:
138+
handler: handler.hello2
139+
environment:
140+
statemachine_arn: ${self:resources.Outputs.HelloStepfunc.Value}
141+
142+
stepFunctions:
143+
stateMachines:
144+
hellostepfunc:
145+
definition:
146+
<your definition>
147+
148+
resources:
149+
Outputs:
150+
HelloStepfunc:
151+
Description: The ARN of the example state machine
152+
Value:
153+
Ref: HellostepfuncStepFunctionsStateMachine
154+
155+
plugins:
156+
- serverless-step-functions
157+
```
158+

0 commit comments

Comments
 (0)