Skip to content

Commit b3d8268

Browse files
committed
Update prod to node22
1 parent 9775363 commit b3d8268

File tree

2 files changed

+29
-38
lines changed

2 files changed

+29
-38
lines changed

spire/templates/apps-300A.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ Parameters:
6868

6969
Conditions:
7070
EnableNestedChangeSetScrubbingResources: !Equals [!Ref NestedChangeSetScrubbingResourcesState, Enabled]
71-
IsProduction: !Equals [!Ref EnvironmentType, Production]
7271

7372
Resources:
7473
NestedChangeSetScrubber: { Type: AWS::SNS::Topic, Condition: EnableNestedChangeSetScrubbingResources }
@@ -146,11 +145,7 @@ Resources:
146145
RootStackName: !Ref RootStackName
147146
RootStackId: !Ref RootStackId
148147
CodeS3Bucket: !Ref DeploymentPackageBucketName
149-
CodeS3ObjectKey:
150-
Fn::If:
151-
- IsProduction
152-
- !Sub /prx/${EnvironmentTypeAbbreviation}/Spire/Dovetail-Analytics/pkg/s3-object-key
153-
- !Sub /prx/${EnvironmentTypeAbbreviation}/Spire/Dovetail-Analytics/v2-beta/pkg/s3-object-key
148+
CodeS3ObjectKey: !Sub /prx/${EnvironmentTypeAbbreviation}/Spire/Dovetail-Analytics/pkg/s3-object-key
154149
DovetailVerifiedMetricsKinesisStreamArn: !Ref DovetailVerifiedMetricsKinesisStreamArn
155150
DovetailVerifiedMetricsKinesisStreamName: !Ref DovetailVerifiedMetricsKinesisStreamName
156151
DovetailCountedKinesisStreamArn: !Ref DovetailCountedKinesisStreamArn

spire/templates/apps/dovetail-analytics.yml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ Resources:
5858
AnalyticsBigqueryFunction:
5959
Type: AWS::Serverless::Function
6060
Properties:
61-
Architectures:
62-
- !If [IsProduction, x86_64, arm64]
61+
Architectures: [arm64]
6362
CodeUri:
6463
Bucket: !Ref CodeS3Bucket
6564
Key: !Ref CodeS3ObjectKey
@@ -81,9 +80,9 @@ Resources:
8180
StartingPosition: LATEST
8281
Stream: !Ref DovetailVerifiedMetricsKinesisStreamArn
8382
Type: Kinesis
84-
Handler: !If [IsProduction, index.handler, index-bigquery.handler]
83+
Handler: index-bigquery.handler
8584
MemorySize: 512
86-
Runtime: !If [IsProduction, nodejs16.x, nodejs22.x]
85+
Runtime: nodejs22.x
8786
Policies:
8887
- !Ref ParameterStoreReadPolicy
8988
- arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole
@@ -206,12 +205,12 @@ Resources:
206205
# Counts the total number of downloads sent to BigQuery?
207206
Type: AWS::Logs::MetricFilter
208207
Properties:
209-
FilterPattern: !If [IsProduction, '{ $.dest = "dt_downloads" }', '{ $.msg = "Finished BigQuery" }']
208+
FilterPattern: '{ $.msg = "Finished BigQuery" }'
210209
LogGroupName: !Ref AnalyticsBigqueryFunctionLogGroup
211210
MetricTransformations:
212211
- MetricName: !Sub bigquery_downloads_${AnalyticsBigqueryFunction}
213212
MetricNamespace: !Ref kMetricFilterNamespace
214-
MetricValue: !If [IsProduction, $.rows, $.downloads]
213+
MetricValue: $.downloads
215214
AnalyticsBigqueryFunctionLowDownloadsAlarm:
216215
Type: AWS::CloudWatch::Alarm
217216
Condition: IsProduction
@@ -244,12 +243,12 @@ Resources:
244243
# Counts the total number of impressions sent to BigQuery?
245244
Type: AWS::Logs::MetricFilter
246245
Properties:
247-
FilterPattern: !If [IsProduction, '{ $.dest = "dt_impressions" }', '{ $.msg = "Finished BigQuery" }']
246+
FilterPattern: '{ $.msg = "Finished BigQuery" }'
248247
LogGroupName: !Ref AnalyticsBigqueryFunctionLogGroup
249248
MetricTransformations:
250249
- MetricName: !Sub bigquery_impressions_${AnalyticsBigqueryFunction}
251250
MetricNamespace: !Ref kMetricFilterNamespace
252-
MetricValue: !If [IsProduction, $.rows, $.impressions]
251+
MetricValue: $.impressions
253252
AnalyticsBigqueryFunctionImpressionsAlarm:
254253
Type: AWS::CloudWatch::Alarm
255254
Condition: IsProduction
@@ -468,8 +467,7 @@ Resources:
468467
AnalyticsDynamoDbFunction:
469468
Type: AWS::Serverless::Function
470469
Properties:
471-
Architectures:
472-
- !If [IsProduction, x86_64, arm64]
470+
Architectures: [arm64]
473471
CodeUri:
474472
Bucket: !Ref CodeS3Bucket
475473
Key: !Ref CodeS3ObjectKey
@@ -490,9 +488,9 @@ Resources:
490488
StartingPosition: LATEST
491489
Stream: !Ref DovetailCountedKinesisStreamArn
492490
Type: Kinesis
493-
Handler: !If [IsProduction, index.handler, index-dynamodb.handler]
491+
Handler: index-dynamodb.handler
494492
MemorySize: 512
495-
Runtime: !If [IsProduction, nodejs16.x, nodejs22.x]
493+
Runtime: nodejs22.x
496494
Policies:
497495
- !Ref ParameterStoreReadPolicy
498496
- arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole
@@ -702,42 +700,41 @@ Resources:
702700
# Counts the number of rows inserted to DynamoDB
703701
Type: AWS::Logs::MetricFilter
704702
Properties:
705-
FilterPattern: !If [IsProduction, '{ $.dest = "dynamodb" }', '{ $.msg = "Finished DynamoDB" }']
703+
FilterPattern: '{ $.msg = "Finished DynamoDB" }'
706704
LogGroupName: !Ref AnalyticsDynamoDbFunctionLogGroup
707705
MetricTransformations:
708706
- MetricName: !Sub dynamodb_inserts_${AnalyticsDynamoDbFunction}
709707
MetricNamespace: !Ref kMetricFilterNamespace
710-
MetricValue: !If [IsProduction, $.rows, $.upserts]
708+
MetricValue: $.upserts
711709

712710
AnalyticsDynamoDbFunctionLookupsMetricFilter:
713711
# Count the number of redirect-datas we've looked up and shuffeld along to
714712
# the metrics-kinesis stream
715713
Type: AWS::Logs::MetricFilter
716714
Properties:
717-
FilterPattern: !If [IsProduction, '{ $.dest = "kinesis*" }', '{ $.msg = "Finished DynamoDB" }']
715+
FilterPattern: '{ $.msg = "Finished DynamoDB" }'
718716
LogGroupName: !Ref AnalyticsDynamoDbFunctionLogGroup
719717
MetricTransformations:
720718
- MetricName: !Sub dynamodb_lookups_${AnalyticsDynamoDbFunction}
721719
MetricNamespace: !Ref kMetricFilterNamespace
722-
MetricValue: !If [IsProduction, $.rows, $.logged]
720+
MetricValue: $.logged
723721

724722
AnalyticsDynamoDbFunctionRetriesMetricFilter:
725723
# Counts the number of retried DynamoDB operations
726724
Type: AWS::Logs::MetricFilter
727725
Properties:
728-
FilterPattern: !If [IsProduction, '{ $.ddb = "retrying" }', '{ $.msg = "Finished DynamoDB" }']
726+
FilterPattern: '{ $.msg = "Finished DynamoDB" }'
729727
LogGroupName: !Ref AnalyticsDynamoDbFunctionLogGroup
730728
MetricTransformations:
731729
- MetricName: !Sub dynamodb_retries_${AnalyticsDynamoDbFunction}
732730
MetricNamespace: !Ref kMetricFilterNamespace
733-
MetricValue: !If [IsProduction, "1", $.failures]
731+
MetricValue: $.failures
734732

735733
# Frequency
736734
AnalyticsFrequencyFunction:
737735
Type: AWS::Serverless::Function
738736
Properties:
739-
Architectures:
740-
- !If [IsProduction, x86_64, arm64]
737+
Architectures: [arm64]
741738
CodeUri:
742739
Bucket: !Ref CodeS3Bucket
743740
Key: !Ref CodeS3ObjectKey
@@ -758,9 +755,9 @@ Resources:
758755
StartingPosition: LATEST
759756
Stream: !Ref DovetailVerifiedMetricsKinesisStreamArn
760757
Type: Kinesis
761-
Handler: !If [IsProduction, index.handler, index-frequency.handler]
758+
Handler: index-frequency.handler
762759
MemorySize: 512
763-
Runtime: !If [IsProduction, nodejs16.x, nodejs22.x]
760+
Runtime: nodejs22.x
764761
Policies:
765762
- !Ref ParameterStoreReadPolicy
766763
- arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole
@@ -977,12 +974,12 @@ Resources:
977974
# Counts the number of impression timestamps added to DynamoDB
978975
Type: AWS::Logs::MetricFilter
979976
Properties:
980-
FilterPattern: !If [IsProduction, '{ $.dest = "dynamodb" }', '{ $.msg = "Finished Frequency" }']
977+
FilterPattern: '{ $.msg = "Finished Frequency" }'
981978
LogGroupName: !Ref AnalyticsFrequencyFunctionLogGroup
982979
MetricTransformations:
983980
- MetricName: !Sub frequency_inserts_${AnalyticsFrequencyFunction}
984981
MetricNamespace: !Ref kMetricFilterNamespace
985-
MetricValue: !If [IsProduction, $.rows, $.added]
982+
MetricValue: $.added
986983

987984
# TODO: not a thing
988985
AnalyticsFrequencyFunctionLookupsMetricFilter:
@@ -1013,8 +1010,7 @@ Resources:
10131010
AnalyticsPingbacksFunction:
10141011
Type: AWS::Serverless::Function
10151012
Properties:
1016-
Architectures:
1017-
- !If [IsProduction, x86_64, arm64]
1013+
Architectures: [arm64]
10181014
CodeUri:
10191015
Bucket: !Ref CodeS3Bucket
10201016
Key: !Ref CodeS3ObjectKey
@@ -1034,9 +1030,9 @@ Resources:
10341030
StartingPosition: LATEST
10351031
Stream: !Ref DovetailVerifiedMetricsKinesisStreamArn
10361032
Type: Kinesis
1037-
Handler: !If [IsProduction, index.handler, index-pingbacks.handler]
1033+
Handler: index-pingbacks.handler
10381034
MemorySize: 2048
1039-
Runtime: !If [IsProduction, nodejs16.x, nodejs22.x]
1035+
Runtime: nodejs22.x
10401036
Policies:
10411037
- !Ref ParameterStoreReadPolicy
10421038
- arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole
@@ -1194,23 +1190,23 @@ Resources:
11941190
# Counts the number of pingbacks sent anywhere
11951191
Type: AWS::Logs::MetricFilter
11961192
Properties:
1197-
FilterPattern: !If [IsProduction, '{ $.dest != "*.adzerk.net" }', '{ $.msg = "Finished Pingbacks" }']
1193+
FilterPattern: '{ $.msg = "Finished Pingbacks" }'
11981194
LogGroupName: !Ref AnalyticsPingbacksFunctionLogGroup
11991195
MetricTransformations:
12001196
- MetricName: !Sub pingbacks_other_${AnalyticsPingbacksFunction}
12011197
MetricNamespace: !Ref kMetricFilterNamespace
1202-
MetricValue: !If [IsProduction, $.rows, $.pingbacks]
1198+
MetricValue: $.pingbacks
12031199

12041200
AnalyticsPingbacksFunctionFailMetricFilter:
12051201
# Counts the number of failed pingbacks
12061202
Type: AWS::Logs::MetricFilter
12071203
Properties:
1208-
FilterPattern: !If [IsProduction, '{ $.msg = "PINGFAIL*" }', '{ $.msg = "Finished Pingbacks" }']
1204+
FilterPattern: '{ $.msg = "Finished Pingbacks" }'
12091205
LogGroupName: !Ref AnalyticsPingbacksFunctionLogGroup
12101206
MetricTransformations:
12111207
- MetricName: !Sub pingbacks_fails_${AnalyticsPingbacksFunction}
12121208
MetricNamespace: !Ref kMetricFilterNamespace
1213-
MetricValue: !If [IsProduction, "1", $.pingfails]
1209+
MetricValue: $.pingfails
12141210

12151211
# CloudWatch Dashboard
12161212
Dashboard:

0 commit comments

Comments
 (0)