-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
48 lines (43 loc) · 1.87 KB
/
template.yaml
File metadata and controls
48 lines (43 loc) · 1.87 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
sam-step-functions-api-tutorial
Sample SAM Template for sam-step-functions-api-tutorial
Resources:
HelloWorldApi:
Type: AWS::Serverless::Api
Properties:
StageName: dev
HelloWorldStateMachine:
Type: AWS::Serverless::StateMachine # More info about State Machine Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html
Properties:
DefinitionUri: statemachine/hello_world.asl.json
DefinitionSubstitutions:
HelloWorldFunctionArn: !GetAtt HelloWorldFunction.Arn
Events:
HelloWorldApiEvent:
Type: Api
Properties:
Method: post
Path: /
RestApiId:
Ref: HelloWorldApi
Policies: # Find out more about SAM policy templates: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-policy-templates.html
- LambdaInvokePolicy:
FunctionName: !Ref HelloWorldFunction
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
Properties:
CodeUri: functions/hello-world/
Handler: app.lambdaHandler
Runtime: nodejs14.x
Outputs:
HelloWorldApi:
Description: "API Gateway endpoint URL to call Hello World State Machine"
Value: !Sub "https://${HelloWorldApi}.execute-api.${AWS::Region}.amazonaws.com/dev/"
HelloWorldStateMachineArn:
Description: "Hello World state machine ARN"
Value: !Ref HelloWorldStateMachine
HelloWorldStateMachineRole:
Description: "IAM Role created for Hello World state machine based on the specified SAM Policy Templates"
Value: !GetAtt HelloWorldStateMachineRole.Arn