Skip to content

Commit 7bbe623

Browse files
rename API to Api
1 parent 75dd44e commit 7bbe623

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

cicd/3-app/javabuilder/template.yml.erb

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ Resources:
100100
- DomainName: !Sub "${SubDomainName}<%=config[:Suffix]%>.${BaseDomainName}"
101101
HostedZoneId: !Ref BaseDomainNameHostedZonedID
102102

103-
<%=config[:Prefix]%>DomainNameAPIMapping:
103+
<%=config[:Prefix]%>DomainNameApiMapping:
104104
Type: AWS::ApiGatewayV2::ApiMapping
105105
DependsOn:
106106
- <%=config[:Prefix]%>Domain
107107
Properties:
108-
ApiId: !Ref <%=apiName%>API
108+
ApiId: !Ref <%=apiName%>Api
109109
DomainName: !Sub "${SubDomainName}<%=config[:Suffix]%>.${BaseDomainName}"
110110
Stage: !Ref <%=apiName%>Stage
111111

112112
<%end -%>
113-
HttpAPI:
113+
HttpApi:
114114
Type: AWS::ApiGatewayV2::Api
115115
Properties:
116116
Name: !Sub "${SubDomainName}-http.${BaseDomainName}"
@@ -119,7 +119,7 @@ Resources:
119119
PutRoute:
120120
Type: AWS::ApiGatewayV2::Route
121121
Properties:
122-
ApiId: !Ref HttpAPI
122+
ApiId: !Ref HttpApi
123123
RouteKey: PUT /seedsources/sources.json
124124
AuthorizationType: CUSTOM
125125
AuthorizerId: !Ref HttpAuthorizer
@@ -143,7 +143,7 @@ Resources:
143143
PutSourcesPermission:
144144
Type: AWS::Lambda::Permission
145145
DependsOn:
146-
- HttpAPI
146+
- HttpApi
147147
Properties:
148148
Action: lambda:InvokeFunction
149149
FunctionName: !Ref PutSourcesFunction
@@ -152,7 +152,7 @@ Resources:
152152
PutIntegration:
153153
Type: AWS::ApiGatewayV2::Integration
154154
Properties:
155-
ApiId: !Ref HttpAPI
155+
ApiId: !Ref HttpApi
156156
Description: PUT Integration
157157
# Integration method must be POST for AWS_PROXY integrations even though we're PUTting into an S3 bucket
158158
IntegrationMethod: POST
@@ -175,7 +175,7 @@ Resources:
175175
AutoDeploy: true
176176
StageName: !Sub "${StageName}"
177177
Description: The stage to deploy
178-
ApiId: !Ref HttpAPI
178+
ApiId: !Ref HttpApi
179179
DefaultRouteSettings:
180180
DetailedMetricsEnabled: true
181181
AccessLogSettings:
@@ -202,7 +202,7 @@ Resources:
202202
HttpAuthorizer:
203203
Type: AWS::ApiGatewayV2::Authorizer
204204
Properties:
205-
ApiId: !Ref HttpAPI
205+
ApiId: !Ref HttpApi
206206
AuthorizerCredentialsArn:
207207
Fn::ImportValue: JavabuilderAPIGatewayRole
208208
AuthorizerPayloadFormatVersion: 2.0
@@ -213,7 +213,7 @@ Resources:
213213
- "$request.querystring.Authorization"
214214
Name: HttpAuthorizer
215215

216-
WebSocketAPI:
216+
WebSocketApi:
217217
Type: AWS::ApiGatewayV2::Api
218218
Properties:
219219
Name: !Sub "${SubDomainName}.${BaseDomainName}"
@@ -223,7 +223,7 @@ Resources:
223223
ConnectRoute:
224224
Type: AWS::ApiGatewayV2::Route
225225
Properties:
226-
ApiId: !Ref WebSocketAPI
226+
ApiId: !Ref WebSocketApi
227227
RouteKey: $connect
228228
AuthorizationType: CUSTOM
229229
AuthorizerId: !Ref WebSocketAuthorizer
@@ -236,7 +236,7 @@ Resources:
236236
WebSocketAuthorizer:
237237
Type: AWS::ApiGatewayV2::Authorizer
238238
Properties:
239-
ApiId: !Ref WebSocketAPI
239+
ApiId: !Ref WebSocketApi
240240
AuthorizerType: REQUEST
241241
AuthorizerUri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${WebsocketAuthorizerLambda.Arn}/invocations"
242242
IdentitySource:
@@ -246,7 +246,7 @@ Resources:
246246
ConnectInteg:
247247
Type: AWS::ApiGatewayV2::Integration
248248
Properties:
249-
ApiId: !Ref WebSocketAPI
249+
ApiId: !Ref WebSocketApi
250250
Description: Connect Integration
251251
IntegrationType: AWS_PROXY
252252
IntegrationUri:
@@ -256,7 +256,7 @@ Resources:
256256
DefaultRoute:
257257
Type: AWS::ApiGatewayV2::Route
258258
Properties:
259-
ApiId: !Ref WebSocketAPI
259+
ApiId: !Ref WebSocketApi
260260
RouteKey: $default
261261
AuthorizationType: NONE
262262
OperationName: DefaultRoute
@@ -269,15 +269,15 @@ Resources:
269269
DefaultIntegration:
270270
Type: AWS::ApiGatewayV2::Integration
271271
Properties:
272-
ApiId: !Ref WebSocketAPI
272+
ApiId: !Ref WebSocketApi
273273
Description: Lambda Proxy Integration
274274
IntegrationType: AWS_PROXY
275275
IntegrationUri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${StartSessionAndRelayMessagesFunction.Arn}/invocations"
276276

277277
DisconnectRoute:
278278
Type: AWS::ApiGatewayV2::Route
279279
Properties:
280-
ApiId: !Ref WebSocketAPI
280+
ApiId: !Ref WebSocketApi
281281
RouteKey: $disconnect
282282
AuthorizationType: NONE
283283
OperationName: DisconnectRoute
@@ -289,7 +289,7 @@ Resources:
289289
DisconnectInteg:
290290
Type: AWS::ApiGatewayV2::Integration
291291
Properties:
292-
ApiId: !Ref WebSocketAPI
292+
ApiId: !Ref WebSocketApi
293293
Description: Disconnect Integration
294294
IntegrationType: AWS_PROXY
295295
IntegrationUri:
@@ -303,15 +303,15 @@ Resources:
303303
- DefaultRoute
304304
- DisconnectRoute
305305
Properties:
306-
ApiId: !Ref WebSocketAPI
306+
ApiId: !Ref WebSocketApi
307307

308308
WebSocketStage:
309309
Type: AWS::ApiGatewayV2::Stage
310310
Properties:
311311
StageName: !Sub "${StageName}"
312312
Description: The stage to deploy
313313
DeploymentId: !Ref WebSocketDeployment
314-
ApiId: !Ref WebSocketAPI
314+
ApiId: !Ref WebSocketApi
315315
DefaultRouteSettings:
316316
DetailedMetricsEnabled: true
317317
LoggingLevel: INFO
@@ -357,18 +357,12 @@ Resources:
357357
StartSessionAndRelayMessagesPermission:
358358
Type: AWS::Lambda::Permission
359359
DependsOn:
360-
- WebSocketAPI
360+
- WebSocketApi
361361
Properties:
362362
Action: lambda:InvokeFunction
363363
FunctionName: !Ref StartSessionAndRelayMessagesFunction
364364
Principal: apigateway.amazonaws.com
365365

366-
# AWS does not seem to be case sensitive, but is case aware. Therefore, we can't update from
367-
# Websocket here to WebSocket as is used elsewhere when updating an existing stack. Updating this is
368-
# a step we should take when we create our non-beta environment from scratch. At that point, we
369-
# should also update uses of HttpAPI and WebSocketAPI to be HttpApi and WebSocketApi, respectively,
370-
# to match the AWS standard elsewhere in this template. Example: "AWS::ApiGatewayV2::ApiMapping"
371-
#
372366
# Note: hourly and daily limit values provided to both authorizers here as environment variables,
373367
# but are only needed in the HTTP authorizer.
374368
# Both authorizers need to access the token_status DynamoDB table, but only the HTTP authorizer
@@ -380,7 +374,7 @@ Resources:
380374
Description: "'Authorize PUT by decoding JWT in Authorization querystring parameter.'"
381375
},
382376
WebSocket: {
383-
LambdaName: "Websocket",
377+
LambdaName: "WebSocket",
384378
Handler: "websocket_authorizer_function",
385379
Description: "'Authorize WebSocket connect by decoding JWT in Authorization querystring parameter.'"
386380
},
@@ -411,7 +405,7 @@ Resources:
411405
Action: lambda:InvokeFunction
412406
FunctionName: !Ref <%=config[:LambdaName]%>AuthorizerLambda
413407
Principal: apigateway.amazonaws.com
414-
SourceArn: !Sub "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${<%=name%>API}/authorizers/${<%=name%>Authorizer}"
408+
SourceArn: !Sub "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${<%=name%>Api}/authorizers/${<%=name%>Authorizer}"
415409
416410
<%end -%>
417411
ChangeJavaRuntimeDirectoryLayer:
@@ -464,7 +458,7 @@ Resources:
464458
CONTENT_BUCKET_URL: !Sub "https://${ContentDomain}"
465459
API_ENDPOINT: !Sub
466460
- "https://${ApiId}.execute-api.${AWS::Region}.amazonaws.com/${StageName}"
467-
- ApiId: !Ref WebSocketAPI
461+
- ApiId: !Ref WebSocketApi
468462
<%end -%>
469463

470464
ContentBucket:
@@ -497,7 +491,7 @@ Resources:
497491
Resource: !Sub "arn:aws:s3:::${ContentBucket}/*"
498492
Principal: '*'
499493

500-
ContentAPICertificate:
494+
ContentApiCertificate:
501495
Type: AWS::CertificateManager::Certificate
502496
Properties:
503497
DomainName: !Sub "${SubDomainName}-content.${BaseDomainName}"
@@ -523,7 +517,7 @@ Resources:
523517
Enabled: true
524518
Aliases: [!Sub "${SubDomainName}-content.${BaseDomainName}"]
525519
ViewerCertificate:
526-
AcmCertificateArn: !Ref ContentAPICertificate
520+
AcmCertificateArn: !Ref ContentApiCertificate
527521
MinimumProtocolVersion: TLSv1
528522
SslSupportMethod: sni-only
529523
CustomErrorResponses:
@@ -607,7 +601,7 @@ Resources:
607601
- Name: Stage
608602
Value: !Sub "${StageName}"
609603
- Name: ApiId
610-
Value: !Ref WebSocketAPI
604+
Value: !Ref WebSocketApi
611605
Period: 60
612606
Stat: Sum
613607
- Id: ad1
@@ -639,7 +633,7 @@ Resources:
639633
MetricName: Count
640634
Dimensions:
641635
- Name: ApiId
642-
Value: !Ref HttpAPI
636+
Value: !Ref HttpApi
643637
Period: 60
644638
Stat: Sum
645639
- Id: ad1

0 commit comments

Comments
 (0)