1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | service: myservice
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | frameworkVersion: '2'
|
22 |
|
23 | provider:
|
24 | name: aws
|
25 | runtime: nodejs12.x
|
26 | lambdaHashingVersion: 20201221
|
27 | stage: dev
|
28 |
|
29 | plugins:
|
30 | - serverless-random-gateway-deployment-id
|
31 |
|
32 | functions:
|
33 |
|
34 | resources:
|
35 | Outputs:
|
36 | Resources:
|
37 | ApiGatewayRestApi:
|
38 | Type: AWS::ApiGateway::RestApi
|
39 | Properties:
|
40 | ApiKeySourceType: HEADER
|
41 | Body: ${file(api.yml)}
|
42 | Description: DCP - Public CheckIn Gateway (${opt:stage, self:provider.stage})
|
43 | FailOnWarnings: false
|
44 | Name: ${opt:stage, self:provider.stage}-gateway
|
45 | EndpointConfiguration:
|
46 | Types:
|
47 | - REGIONAL
|
48 | ApiGatewayDeployment:
|
49 | Type: AWS::ApiGateway::Deployment
|
50 | Properties:
|
51 | Description: ${opt:stage, self:provider.stage}
|
52 | RestApiId: !Ref ApiGatewayRestApi
|
53 | ApiGatewayStage:
|
54 | Type: AWS::ApiGateway::Stage
|
55 | Properties:
|
56 | StageName: ${opt:stage, self:provider.stage}
|
57 | Description: ${opt:stage, self:provider.stage} Stage
|
58 | RestApiId: !Ref ApiGatewayRestApi
|
59 | DeploymentId: !Ref ApiGatewayDeployment
|
60 | MethodSettings:
|
61 | - DataTraceEnabled: true
|
62 | HttpMethod: "*"
|
63 | LoggingLevel: ERROR
|
64 | ResourcePath: "/*"
|
65 | MetricsEnabled: true
|
66 | ApiGatewayBasePath:
|
67 | Type: AWS::ApiGateway::BasePathMapping
|
68 | DependsOn: ApiGatewayStage
|
69 | Properties:
|
70 | BasePath: some-path
|
71 | DomainName: www.test.de
|
72 | RestApiId: !Ref ApiGatewayRestApi
|
73 | Stage: !Ref ApiGatewayStage
|