This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 423
/
Copy pathproduct-mock.yaml
69 lines (62 loc) · 1.75 KB
/
product-mock.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
product-service
SAM Template for mock product-service
Parameters:
AllowedOrigin:
Type: 'String'
Globals:
Function:
Timeout: 5
Tracing: Active
AutoPublishAlias: live
Runtime: python3.8
MemorySize: 256
Environment:
Variables:
LOG_LEVEL: "DEBUG"
ALLOWED_ORIGIN: !Ref AllowedOrigin
POWERTOOLS_SERVICE_NAME: product-mock
POWERTOOLS_METRICS_NAMESPACE: ecommerce-app
Api:
EndpointConfiguration: REGIONAL
TracingEnabled: true
OpenApiVersion: '2.0'
Cors:
AllowMethods: "'OPTIONS,POST,GET'"
AllowHeaders: "'Content-Type'"
AllowOrigin: !Sub "'${AllowedOrigin}'"
Resources:
GetProductFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: product-mock-service/
Handler: get_product.lambda_handler
Events:
ListCart:
Type: Api
Properties:
Path: /product/{product_id}
Method: get
GetProductsFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: product-mock-service/
Handler: get_products.lambda_handler
Events:
ListCart:
Type: Api
Properties:
Path: /product
Method: get
GetProductApiUrl:
Type: AWS::SSM::Parameter
Properties:
Type: String
Name: /serverless-shopping-cart-demo/products/products-api-url
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"
Outputs:
ProductApi:
Description: "API Gateway endpoint URL for Prod stage for Product Mock Service"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"