@@ -84,37 +84,34 @@ Resources:
8484 AppGroup : OrdersLambda
8585 AppType : Serverless
8686
87- # GetMyOrdersFunction:
88- # Type: AWS::Serverless::Function
89- # Properties:
90- # CodeUri: src/
91- # Handler: handlers/getMyOrders.handler
92- # Runtime: nodejs22.x
93- # MemorySize: 128
94- # Timeout: 10
95- # Policies:
96- # - AWSLambdaVPCAccessExecutionRole
97- # - AmazonDynamoDBFullAccess
98- # - AWSLambdaSQSQueueExecutionRole
99- # - AWSLambdaBasicExecutionRole
100- # - AWSSecretsManagerGetSecretValuePolicy:
101- # SecretArn: !Sub "arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:mongodb/credentials-*"
102- # Environment:
103- # Variables:
104- # HOSTING_ENV: !Ref HOSTINGENV
105- # DB_URI: ""
106- # REDIS_HOST: ""
107- # MONGODB_SECRET_ARN: !Sub "arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:mongodb/credentials"
108- # VpcConfig:
109- # SecurityGroupIds: !Ref SecurityGroupIds
110- # SubnetIds: !Ref SubnetIds
111- # Events:
112- # ApiEvent:
113- # Type: Api
114- # Properties:
115- # Path: /myorders
116- # Method: post
117- # RestApiId: !Ref OrderApi
87+ GetMyOrdersFunction :
88+ Type : AWS::Serverless::Function
89+ Properties :
90+ CodeUri : src/
91+ Handler : handlers/getMyOrders.handler
92+ Runtime : nodejs22.x
93+ MemorySize : 128
94+ Timeout : 10
95+ Policies :
96+ - DynamoDBCrudPolicy :
97+ TableName :
98+ !Ref DynamoDBOrdersTable
99+ - AWSLambdaVPCAccessExecutionRole
100+ - AmazonDynamoDBFullAccess
101+ - AWSLambdaSQSQueueExecutionRole
102+ - AWSLambdaBasicExecutionRole
103+ - AWSSecretsManagerGetSecretValuePolicy :
104+ SecretArn : !Sub "arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:mongodb/credentials-*"
105+ Environment :
106+ Variables :
107+ HOSTING_ENV : !Ref HOSTINGENV
108+ Events :
109+ ApiEvent :
110+ Type : Api
111+ Properties :
112+ Path : /myorders
113+ Method : get
114+ RestApiId : !Ref OrderApi
118115
119116Outputs :
120117 # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
0 commit comments