-
Notifications
You must be signed in to change notification settings - Fork 881
/
Copy path__main__.py
34 lines (30 loc) · 902 Bytes
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright 2016-2018, Pulumi Corporation. All rights reserved.
import iam
import pulumi
from pulumi_aws import lambda_, sfn
hello_world_fn = lambda_.Function(
"helloWorldFunction",
role=iam.lambda_role.arn,
runtime="python3.12",
handler="hello.handler",
code=pulumi.AssetArchive({".": pulumi.FileArchive("./step_hello")}),
)
state_defn = state_machine = sfn.StateMachine(
"stateMachine",
role_arn=iam.sfn_role.arn,
definition=hello_world_fn.arn.apply(
lambda arn: """{
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "%s",
"End": true
}
}
}"""
% arn
),
)
pulumi.export("state_machine_arn", state_machine.id)