-
Notifications
You must be signed in to change notification settings - Fork 13
/
template.yaml
37 lines (34 loc) · 1.02 KB
/
template.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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: A Swagger UI for AWS API Gateway.
Parameters:
SwaggerSpecURL:
Type: String
Default: https://petstore.swagger.io/v2/swagger.json
Description: Enter a publicly accessible URL to the Swagger spec JSON/YAML.
Resources:
SwaggerUiFunction:
Type: AWS::Serverless::Function
Properties:
Description: The Lambda function that serves the Swagger UI.
CodeUri: swagger-ui/
Handler: app.handler
Runtime: nodejs20.x
Environment:
Variables:
SWAGGER_SPEC_URL: !Ref SwaggerSpecURL
Events:
SwaggerUiApi:
Type: Api
Properties:
Path: /swagger
Method: GET
SwaggerUiApiProxy:
Type: Api
Properties:
Path: /swagger/{proxy+}
Method: GET
Outputs:
SwaggerUiUrl:
Description: Swagger UI URL
Value: !Sub https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/swagger/