Skip to content

Commit 04f83f0

Browse files
committed
force all requests to lambda
1 parent a849207 commit 04f83f0

File tree

2 files changed

+33
-24
lines changed

2 files changed

+33
-24
lines changed

cloudformation/main.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,11 @@ Resources:
119119
Name: !Sub ${ApplicationPrefix}-gateway
120120
Description: !Sub "${ApplicationFriendlyName} API Gateway"
121121
AlwaysDeploy: True
122-
DefinitionBody:
123-
/{proxy+}:
124-
x-amazon-apigateway-any-method:
125-
produces:
126-
- "application/json"
127-
responses: {}
128-
x-amazon-apigateway-integration:
129-
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ApplicationPrefix}-lambda/invocations
130-
responses:
131-
default:
132-
statusCode: "200"
133-
passthroughBehavior: "when_no_match"
134-
httpMethod: "POST"
135-
type: "aws_proxy"
136-
basePath: "/"
137-
schemes:
138-
- "https"
139-
x-amazon-apigateway-policy:
140-
Version: "2012-10-17"
141-
Statement:
142-
- Effect: "Allow"
143-
Principal: "*"
144-
Action: "execute-api:Invoke"
145-
Resource: "execute-api:/*"
122+
DefinitionBody:
123+
Fn::Transform:
124+
Name: AWS::Include
125+
Parameters:
126+
Location: ./phony-swagger.yml
146127
Domain:
147128
DomainName: !Sub
148129
- "${ApplicationPrefix}.${BaseDomainName}"

cloudformation/phony-swagger.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.0.3
2+
info:
3+
title: ACM UIUC Redirect All API
4+
version: "1.0.0"
5+
contact:
6+
name: ACM Infrastructure Team
7+
email: infra@acm.illinois.edu
8+
9+
paths:
10+
/{proxy+}:
11+
x-amazon-apigateway-any-method:
12+
responses:
13+
200:
14+
description: OK
15+
16+
x-amazon-apigateway-auth:
17+
type: NONE
18+
19+
x-amazon-apigateway-integration:
20+
responses:
21+
default:
22+
statusCode: 200
23+
passthroughBehavior: when_no_match
24+
httpMethod: POST
25+
contentHandling: CONVERT_TO_TEXT
26+
type: aws_proxy
27+
uri:
28+
Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ApplicationPrefix}-lambda/invocations"

0 commit comments

Comments
 (0)