-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
90 lines (86 loc) · 2.71 KB
/
api.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
swagger: "2.0"
info:
version: "1.0"
title: "order-app"
basePath: "/Dev"
schemes:
- "https"
paths:
/orders:
get:
responses: {}
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ApiGwExecutionRole, Arn]
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetOrders.Arn}/invocations
passthroughBehavior: "when_no_match"
post:
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "200 response"
x-amazon-apigateway-integration:
type: "aws"
credentials:
Fn::GetAtt: [ApiGwExecutionRole, Arn]
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:sqs:path/${AWS::AccountId}/${OrderQueue.QueueName}
responses:
default:
statusCode: "200"
requestParameters:
integration.request.header.Content-Type: "'application/x-www-form-urlencoded'"
requestTemplates:
application/json: 'Action=SendMessage&MessageBody={"data":$input.json(''$''),"cognito_userid":"$context.authorizer.claims[''cognito:username'']"}'
passthroughBehavior: "when_no_match"
/orders/{orderId+}:
get:
responses: {}
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ApiGwExecutionRole, Arn]
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetSingleOrder.Arn}/invocations
passthroughBehavior: "when_no_match"
put:
produces:
- "application/json"
parameters:
- name: "orderId"
in: "path"
required: true
type: "string"
responses: {}
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ApiGwExecutionRole, Arn]
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${UpdateOrder.Arn}/invocations
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
type: "aws_proxy"
delete:
responses: {}
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ApiGwExecutionRole, Arn]
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DeleteOrder.Arn}/invocations
passthroughBehavior: "when_no_match"
security:
- MyCognitoAuthorizer:
- "order-api/delete_order"