Skip to content

Commit 447488e

Browse files
authored
Update the_state_machine_stack.py
1 parent a75816e commit 447488e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

the-state-machine/python/the_state_machine/the_state_machine_stack.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
1717

1818
# The first thing we need to do is see if they are asking for pineapple on a pizza
1919
pineapple_check_lambda = _lambda.Function(self, "pineappleCheckLambdaHandler",
20-
runtime=_lambda.Runtime.NODEJS_12_X, # execution environment
21-
handler="orderPizza.handler", # file is "orderPizza", function is "handler"
22-
code=_lambda.Code.from_asset("lambda_fns"), # code loaded from the "lambda_fns" directory
20+
runtime=_lambda.Runtime.NODEJS_12_X,
21+
handler="orderPizza.handler",
22+
code=_lambda.Code.from_asset("lambda_fns"),
2323
)
2424

2525
# Step functions are built up of steps, we need to define our first step
26-
# Refactored code because sfn.Task is Depecrated right now. Using StepFunctionsTaks.LambdaInvoke instead
27-
# https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.Task.html
2826
order_pizza = step_fn_tasks.LambdaInvoke(self, 'Order Pizza Job',
2927
lambda_function=pineapple_check_lambda,
3028
input_path='$.flavour',
@@ -54,9 +52,9 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
5452

5553
# defines an AWS Lambda resource to connect to our API Gateway
5654
state_machine_lambda = _lambda.Function(self, "stateMachineLambdaHandler",
57-
runtime=_lambda.Runtime.NODEJS_12_X, # execution environment
58-
handler="stateMachineLambda.handler", # file is "stateMachineLambda", function is "handler
59-
code=_lambda.Code.from_asset("lambda_fns"), # code loaded from the "lambda_fns" directory
55+
runtime=_lambda.Runtime.NODEJS_12_X,
56+
handler="stateMachineLambda.handler",
57+
code=_lambda.Code.from_asset("lambda_fns"),
6058
environment={
6159
'statemachine_arn': state_machine.state_machine_arn
6260
}
@@ -65,7 +63,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
6563
state_machine.grant_start_execution(state_machine_lambda)
6664

6765
# Simple API Gateway proxy integration
68-
# defines an API Gateway REST API resource backed by our "sqs_publish_lambda" function.
66+
# defines an API Gateway REST API resource backed by our "state_machine_lambda" function.
6967
api_gw.LambdaRestApi(self, 'Endpoint',
7068
handler=state_machine_lambda
71-
)
69+
)

0 commit comments

Comments
 (0)