@@ -4,13 +4,13 @@ Description: Provision an instance of the Javabuilder service. Empty the Content
44Parameters:
55 BaseDomainName:
66 Type: String
7- Description: Base domain name.
7+ Description: Base domain name (e.g. 'code.org' in 'javabuilder.code.org') .
88 BaseDomainNameHostedZonedID:
99 Type: String
1010 Description: AWS Route53 Hosted Zone ID for base domain name.
11- SubDomainName :
11+ SubdomainName :
1212 Type: String
13- Description: Sub domain name for javabuilder service.
13+ Description: Subdomain name for javabuilder service (e.g. 'javabuilder' in 'javabuilder.code.org') .
1414 # LogBucket:
1515 # Type: String
1616 # Default: cdo-logs.s3.amazonaws.com
@@ -76,7 +76,7 @@ Resources:
7676 Type: AWS::Route53::RecordSet
7777 Properties:
7878 HostedZoneName: !Sub "${BaseDomainName}."
79- Name: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
79+ Name: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
8080 Type: A
8181 AliasTarget:
8282 DNSName: !GetAtt <%= config[:Prefix]%> DomainName.RegionalDomainName
@@ -85,19 +85,19 @@ Resources:
8585 <%= config[:Prefix]%> DomainName:
8686 Type: AWS::ApiGatewayV2::DomainName
8787 Properties:
88- DomainName: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
88+ DomainName: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
8989 DomainNameConfigurations:
9090 - EndpointType: REGIONAL
9191 CertificateArn: !Ref <%= config[:Prefix]%> Certificate
92- CertificateName: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
92+ CertificateName: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
9393
9494 <%= config[:Prefix]%> Certificate:
9595 Type: AWS::CertificateManager::Certificate
9696 Properties:
97- DomainName: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
97+ DomainName: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
9898 ValidationMethod: DNS
9999 DomainValidationOptions:
100- - DomainName: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
100+ - DomainName: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
101101 HostedZoneId: !Ref BaseDomainNameHostedZonedID
102102
103103 <%= config[:Prefix]%> DomainNameAPIMapping:
@@ -106,14 +106,14 @@ Resources:
106106 - <%= config[:Prefix]%> Domain
107107 Properties:
108108 ApiId: !Ref <%= apiName%> API
109- DomainName: !Sub "${SubDomainName }<%= config[:Suffix]%> .${BaseDomainName}"
109+ DomainName: !Sub "${SubdomainName }<%= config[:Suffix]%> .${BaseDomainName}"
110110 Stage: !Ref <%= apiName%> Stage
111111
112112<% end -%>
113113 HttpAPI:
114114 Type: AWS::ApiGatewayV2::Api
115115 Properties:
116- Name: !Sub "${SubDomainName }-http.${BaseDomainName}"
116+ Name: !Sub "${SubdomainName }-http.${BaseDomainName}"
117117 ProtocolType: HTTP
118118
119119 PutRoute:
@@ -165,7 +165,7 @@ Resources:
165165 HttpStageLogs:
166166 Type: AWS::Logs::LogGroup
167167 Properties:
168- LogGroupName: !Sub "/aws/apigateway/accesslog/${SubDomainName }-http.${BaseDomainName}"
168+ LogGroupName: !Sub "/aws/apigateway/accesslog/${SubdomainName }-http.${BaseDomainName}"
169169
170170 HttpStage:
171171 Type: AWS::ApiGatewayV2::Stage
@@ -179,7 +179,7 @@ Resources:
179179 DefaultRouteSettings:
180180 DetailedMetricsEnabled: true
181181 AccessLogSettings:
182- DestinationArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/apigateway/accesslog/${SubDomainName }-http.${BaseDomainName}"
182+ DestinationArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/apigateway/accesslog/${SubdomainName }-http.${BaseDomainName}"
183183 # TODO: Also log authorizer status code, authorizer error message, Javabuilder session id, and Origin.
184184 Format: '{
185185 "host": "$context.domainName",
@@ -216,7 +216,7 @@ Resources:
216216 WebSocketAPI:
217217 Type: AWS::ApiGatewayV2::Api
218218 Properties:
219- Name: !Sub "${SubDomainName }.${BaseDomainName}"
219+ Name: !Sub "${SubdomainName }.${BaseDomainName}"
220220 ProtocolType: WEBSOCKET
221221 RouteSelectionExpression: "$request.body.action"
222222
@@ -317,7 +317,7 @@ Resources:
317317 LoggingLevel: INFO
318318 DataTraceEnabled: true
319319 AccessLogSettings:
320- DestinationArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/apigateway/accesslog/${SubDomainName }.${BaseDomainName}"
320+ DestinationArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/apigateway/accesslog/${SubdomainName }.${BaseDomainName}"
321321 # TODO: Also log authorizer status code, authorizer error message, Javabuilder session id, and Origin.
322322 Format: '{
323323 "host": "$context.domainName",
@@ -470,7 +470,7 @@ Resources:
470470 ContentBucket:
471471 Type: AWS::S3::Bucket
472472 Properties:
473- BucketName: !If [IsDevCondition, !Sub "cdo-dev-${SubDomainName }-content", !Sub "cdo-${SubDomainName }-content"]
473+ BucketName: !If [IsDevCondition, !Sub "cdo-dev-${SubdomainName }-content", !Sub "cdo-${SubdomainName }-content"]
474474 CorsConfiguration:
475475 CorsRules:
476476 - AllowedMethods: [GET, PUT]
@@ -500,17 +500,17 @@ Resources:
500500 ContentAPICertificate:
501501 Type: AWS::CertificateManager::Certificate
502502 Properties:
503- DomainName: !Sub "${SubDomainName }-content.${BaseDomainName}"
503+ DomainName: !Sub "${SubdomainName }-content.${BaseDomainName}"
504504 ValidationMethod: DNS
505505 DomainValidationOptions:
506- - DomainName: !Sub "${SubDomainName }-content.${BaseDomainName}"
506+ - DomainName: !Sub "${SubdomainName }-content.${BaseDomainName}"
507507 HostedZoneId: !Ref BaseDomainNameHostedZonedID
508508
509509 ContentDomain:
510510 Type: AWS::Route53::RecordSet
511511 Properties:
512512 HostedZoneName: !Sub "${BaseDomainName}."
513- Name: !Sub "${SubDomainName }-content.${BaseDomainName}"
513+ Name: !Sub "${SubdomainName }-content.${BaseDomainName}"
514514 Type: A
515515 AliasTarget:
516516 DNSName: !GetAtt ContentCDN.DomainName
@@ -521,7 +521,7 @@ Resources:
521521 Properties:
522522 DistributionConfig:
523523 Enabled: true
524- Aliases: [!Sub "${SubDomainName }-content.${BaseDomainName}"]
524+ Aliases: [!Sub "${SubdomainName }-content.${BaseDomainName}"]
525525 ViewerCertificate:
526526 AcmCertificateArn: !Ref ContentAPICertificate
527527 MinimumProtocolVersion: TLSv1
@@ -533,7 +533,7 @@ Resources:
533533 # Logging:
534534 # Bucket: !Ref LogBucket
535535 # IncludeCookies: false
536- # Prefix: !Sub "${SubDomainName }-content.${BaseDomainName}"
536+ # Prefix: !Sub "${SubdomainName }-content.${BaseDomainName}"
537537 Origins:
538538 - Id: ContentBucket
539539 DomainName: !GetAtt ContentBucket.DomainName
@@ -549,7 +549,7 @@ Resources:
549549 HighConcurrentExecutionsAlarm:
550550 Type: AWS::CloudWatch::Alarm
551551 Properties:
552- AlarmName: !Sub "${SubDomainName }_high_concurrent_executions"
552+ AlarmName: !Sub "${SubdomainName }_high_concurrent_executions"
553553 AlarmDescription: !Sub |
554554 This will page the DOTD if javabuilder usage exceeds 50 concurrent
555555 executions for 10 minutes. Occasional spikes are expected, but
@@ -589,7 +589,7 @@ Resources:
589589 HighWebsocketConnectionsAlarm:
590590 Type: AWS::CloudWatch::Alarm
591591 Properties:
592- AlarmName: !Sub "${SubDomainName }_high_websocket_connections"
592+ AlarmName: !Sub "${SubdomainName }_high_websocket_connections"
593593 AlarmDescription: Significantly higher websocket connections than normal detected. Investigate if there is a DDOS.
594594 ActionsEnabled: false
595595 EvaluationPeriods: 20
@@ -619,7 +619,7 @@ Resources:
619619 HighHttpRequestsAlarm:
620620 Type: AWS::CloudWatch::Alarm
621621 Properties:
622- AlarmName: !Sub "${SubDomainName }_high_http_requests"
622+ AlarmName: !Sub "${SubdomainName }_high_http_requests"
623623 AlarmDescription: Significantly higher HTTP requests than normal detected.
624624 Investigate if there is a DDOS.
625625 ActionsEnabled: true
@@ -664,12 +664,12 @@ Resources:
664664 AlarmDescription: Send message if abnormally high Javabuilder usage detected.
665665 Monitors usage across the HTTP API, WebSocket API, and all Build and Run
666666 Lambdas.
667- AlarmName: !Sub "${SubDomainName }_high_usage_composite"
668- AlarmRule: !Sub "ALARM(${SubDomainName }_console_high_invocations) OR
669- ALARM(${SubDomainName }_high_http_requests) OR
670- ALARM(${SubDomainName }_high_websocket_connections) OR
671- ALARM(${SubDomainName }_neighborhood_high_invocations) OR
672- ALARM(${SubDomainName }_theater_high_invocations)"
667+ AlarmName: !Sub "${SubdomainName }_high_usage_composite"
668+ AlarmRule: !Sub "ALARM(${SubdomainName }_console_high_invocations) OR
669+ ALARM(${SubdomainName }_high_http_requests) OR
670+ ALARM(${SubdomainName }_high_websocket_connections) OR
671+ ALARM(${SubdomainName }_neighborhood_high_invocations) OR
672+ ALARM(${SubdomainName }_theater_high_invocations)"
673673 InsufficientDataActions: []
674674 OKActions: []
675675
@@ -678,7 +678,7 @@ Resources:
678678 <%= name%> HighSevereErrorRateAlarm:
679679 Type: AWS::CloudWatch::Alarm
680680 Properties:
681- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _high_severe_error_rate"
681+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _high_severe_error_rate"
682682 AlarmDescription: Send page if Javabuilder severe error rate exceeds 10% for 20
683683 minutes. Occasional spikes are expected, but a sustained high error rate
684684 is an indication of an outage.
@@ -721,7 +721,7 @@ Resources:
721721 <%= name%> HighErrorRateAlarm:
722722 Type: AWS::CloudWatch::Alarm
723723 Properties:
724- AlarmName: !Sub "${SubDomainName }_build_and_run_<%= name . downcase%> _lambda_error_rate"
724+ AlarmName: !Sub "${SubdomainName }_build_and_run_<%= name . downcase%> _lambda_error_rate"
725725 AlarmDescription: Error rate in Javabuilder's <%= name%> build and run lambda (the core of
726726 Javabuilder, which executes student <%= name%> code) exceeded 10% for four
727727 consecutive 5 minute periods.
@@ -775,7 +775,7 @@ Resources:
775775 <%= name%> SlowCleanupTimeAlarm:
776776 Type: AWS::CloudWatch::Alarm
777777 Properties:
778- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _slow_cleanup_time"
778+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _slow_cleanup_time"
779779 AlarmDescription: Average cleanup time in Javabuilder's <%= name%> build and run lambda was high for at
780780 least 15 out of the last 20 minutes. Investigate if there has been a performance regression.
781781 ActionsEnabled: true
@@ -799,7 +799,7 @@ Resources:
799799 <%= name%> SlowColdBootTimeAlarm:
800800 Type: AWS::CloudWatch::Alarm
801801 Properties:
802- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _slow_cold_boot_time"
802+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _slow_cold_boot_time"
803803 AlarmDescription: Average cold boot time in Javabuilder's <%= name%> build and run lambda was high for at
804804 least 15 out of the last 20 minutes. Investigate if there has been a performance regression.
805805 ActionsEnabled: true
@@ -823,7 +823,7 @@ Resources:
823823 <%= name%> SlowInitializationTimeAlarm:
824824 Type: AWS::CloudWatch::Alarm
825825 Properties:
826- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _slow_initialization_time"
826+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _slow_initialization_time"
827827 AlarmDescription: Average initialization time in Javabuilder's <%= name%> build and run lambda was high for at
828828 least 15 out of the last 20 minutes. Investigate if there has been a performance regression.
829829 ActionsEnabled: true
@@ -848,7 +848,7 @@ Resources:
848848 <%= name%> SlowTransitionTimeAlarm:
849849 Type: AWS::CloudWatch::Alarm
850850 Properties:
851- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _slow_transition_time"
851+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _slow_transition_time"
852852 AlarmDescription: Average transition time in Javabuilder's <%= name%> build and run lambda was high for at
853853 least 15 out of the last 20 minutes. Investigate if there has been a performance regression.
854854 ActionsEnabled: true
@@ -872,7 +872,7 @@ Resources:
872872 <%= name%> HighInvocationsAlarm:
873873 Type: AWS::CloudWatch::Alarm
874874 Properties:
875- AlarmName: !Sub "${SubDomainName }_<%= name . downcase%> _high_invocations"
875+ AlarmName: !Sub "${SubdomainName }_<%= name . downcase%> _high_invocations"
876876 AlarmDescription: Significantly higher <%= name%> build and run invocations than
877877 normal detected. Investigate if there is a DDOS.
878878 ActionsEnabled: false
@@ -915,7 +915,7 @@ Resources:
915915 BlockedUsersTable:
916916 Type: AWS::DynamoDB::Table
917917 Properties:
918- TableName: !Sub "${SubDomainName }_blocked_users"
918+ TableName: !Sub "${SubdomainName }_blocked_users"
919919 KeySchema:
920920 - AttributeName: <%= DOMAIN_AND_USER_ID_COMPOSITE_ATTRIBUTE_NAME%>
921921 KeyType: HASH
@@ -929,7 +929,7 @@ Resources:
929929 TokenStatusTable:
930930 Type: AWS::DynamoDB::Table
931931 Properties:
932- TableName: !Sub "${SubDomainName }_tokens"
932+ TableName: !Sub "${SubdomainName }_tokens"
933933 KeySchema:
934934 - AttributeName: <%= TOKEN_ID_ATTRIBUTE_NAME%>
935935 KeyType: HASH
@@ -944,7 +944,7 @@ Resources:
944944 UserRequestsTable:
945945 Type: AWS::DynamoDB::Table
946946 Properties:
947- TableName: !Sub "${SubDomainName }_user_requests"
947+ TableName: !Sub "${SubdomainName }_user_requests"
948948 KeySchema:
949949 - AttributeName: <%= DOMAIN_AND_USER_ID_COMPOSITE_ATTRIBUTE_NAME%>
950950 KeyType: HASH
@@ -963,7 +963,7 @@ Resources:
963963 TeacherAssociatedRequestsTable:
964964 Type: AWS::DynamoDB::Table
965965 Properties:
966- TableName: !Sub "${SubDomainName }_teacher_associated_requests"
966+ TableName: !Sub "${SubdomainName }_teacher_associated_requests"
967967 KeySchema:
968968 - AttributeName: <%= DOMAIN_AND_SECTION_OWNER_ID_COMPOSITE_ATTRIBUTE_NAME%>
969969 KeyType: HASH
@@ -982,7 +982,7 @@ Resources:
982982 HighUsersBlockedAlarm:
983983 Type: AWS::CloudWatch::Alarm
984984 Properties:
985- AlarmName: !Sub "${SubDomainName }_high_users_blocked"
985+ AlarmName: !Sub "${SubdomainName }_high_users_blocked"
986986 AlarmDescription: Unusually high number of users being blocked by our throttling
987987 thresholds.
988988 ActionsEnabled: true
@@ -1006,7 +1006,7 @@ Resources:
10061006 HighClassroomsBlockedAlarm:
10071007 Type: AWS::CloudWatch::Alarm
10081008 Properties:
1009- AlarmName: !Sub "${SubDomainName }_high_classrooms_blocked"
1009+ AlarmName: !Sub "${SubdomainName }_high_classrooms_blocked"
10101010 AlarmDescription: Unusually high number of classrooms being blocked by our throttling
10111011 thresholds.
10121012 ActionsEnabled: true
@@ -1030,7 +1030,7 @@ Resources:
10301030 HighUnknownTokensAlarm:
10311031 Type: AWS::CloudWatch::Alarm
10321032 Properties:
1033- AlarmName: !Sub "${SubDomainName }_high_unknown_tokens"
1033+ AlarmName: !Sub "${SubdomainName }_high_unknown_tokens"
10341034 AlarmDescription: Websocket authorizer is receiving connection requests using
10351035 tokens that did not pass through the HTTP authorizer first.
10361036 ActionsEnabled: true
@@ -1054,7 +1054,7 @@ Resources:
10541054 HighUnvettedTokensAlarm:
10551055 Type: AWS::CloudWatch::Alarm
10561056 Properties:
1057- AlarmName: !Sub "${SubDomainName }_high_unvetted_tokens"
1057+ AlarmName: !Sub "${SubdomainName }_high_unvetted_tokens"
10581058 AlarmDescription: Websocket authorizer is receiving connection requests using
10591059 tokens that were observed but not vetted as valid by the HTTP authorizer.
10601060 ActionsEnabled: true
@@ -1078,7 +1078,7 @@ Resources:
10781078 WebsocketHighUsedTokensAlarm:
10791079 Type: AWS::CloudWatch::Alarm
10801080 Properties:
1081- AlarmName: !Sub "${SubDomainName }_websocket_high_used_tokens"
1081+ AlarmName: !Sub "${SubdomainName }_websocket_high_used_tokens"
10821082 AlarmDescription: Websocket authorizer is receiving connection requests using
10831083 tokens have already been used.
10841084 ActionsEnabled: true
@@ -1102,7 +1102,7 @@ Resources:
11021102 HttpHighUsedTokensAlarm:
11031103 Type: AWS::CloudWatch::Alarm
11041104 Properties:
1105- AlarmName: !Sub "${SubDomainName }_http_high_used_tokens"
1105+ AlarmName: !Sub "${SubdomainName }_http_high_used_tokens"
11061106 AlarmDescription: HTTP authorizer is receiving connection requests using
11071107 tokens have already been used.
11081108 ActionsEnabled: true
@@ -1126,4 +1126,4 @@ Resources:
11261126Outputs:
11271127 JavabuilderURL:
11281128 Value:
1129- Fn::Sub: wss://${SubDomainName }.${BaseDomainName}
1129+ Fn::Sub: wss://${SubdomainName }.${BaseDomainName}
0 commit comments