Skip to content

Commit c31be7c

Browse files
DHAMODHARABALAJI RDHAMODHARABALAJI R
authored andcommitted
..
1 parent 8a22529 commit c31be7c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

order-manager/template.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,35 @@ Resources:
113113
Method: get
114114
RestApiId: !Ref OrderApi
115115

116+
GetOrderFunction:
117+
Type: AWS::Serverless::Function
118+
Properties:
119+
CodeUri: src/
120+
Handler: handlers/getOrder.handler
121+
Runtime: nodejs22.x
122+
MemorySize: 128
123+
Timeout: 10
124+
Policies:
125+
- DynamoDBCrudPolicy:
126+
TableName:
127+
!Ref DynamoDBOrdersTable
128+
- AWSLambdaVPCAccessExecutionRole
129+
- AmazonDynamoDBFullAccess
130+
- AWSLambdaSQSQueueExecutionRole
131+
- AWSLambdaBasicExecutionRole
132+
- AWSSecretsManagerGetSecretValuePolicy:
133+
SecretArn: !Sub "arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:mongodb/credentials-*"
134+
Environment:
135+
Variables:
136+
HOSTING_ENV: !Ref HOSTINGENV
137+
Events:
138+
ApiEvent:
139+
Type: Api
140+
Properties:
141+
Path: /orders/{id}
142+
Method: get
143+
RestApiId: !Ref OrderApi
144+
116145
Outputs:
117146
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
118147
# Find out more about other implicit resources you can reference within SAM

0 commit comments

Comments
 (0)