Skip to content

Commit 201c06f

Browse files
authored
refactor(iac): upgraded NodeJSFunction to use applicationLogLevelV2, loggingFormat (#85)
Replaced deprecated applicationLogLevel & logFormat BREAKING CHANGE: Potentially will cause issues if rollback is needed due to logging upgrade. May be fine though re: #81
1 parent b3200da commit 201c06f

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

lib/authentication/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
ApplicationLogLevel,
3434
Architecture,
3535
LambdaInsightsVersion,
36-
LogFormat,
36+
LoggingFormat,
3737
Runtime,
3838
Tracing
3939
} from 'aws-cdk-lib/aws-lambda'
@@ -106,8 +106,8 @@ export class Authentication extends Construct {
106106
architecture: Architecture.ARM_64,
107107
runtime: Runtime.NODEJS_20_X,
108108
tracing: Tracing.ACTIVE,
109-
logFormat: LogFormat.JSON,
110-
applicationLogLevel: ApplicationLogLevel.DEBUG,
109+
loggingFormat: LoggingFormat.JSON,
110+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
111111
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
112112
memorySize: 128,
113113
timeout: Duration.seconds(5),

lib/authorization/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ApplicationLogLevel,
1717
Architecture,
1818
LambdaInsightsVersion,
19-
LogFormat,
19+
LoggingFormat,
2020
Runtime,
2121
Tracing
2222
} from 'aws-cdk-lib/aws-lambda'
@@ -123,8 +123,8 @@ export class Authorization extends Construct {
123123
architecture: Architecture.ARM_64,
124124
runtime: Runtime.NODEJS_20_X,
125125
tracing: Tracing.ACTIVE,
126-
logFormat: LogFormat.JSON,
127-
applicationLogLevel: ApplicationLogLevel.DEBUG,
126+
loggingFormat: LoggingFormat.JSON,
127+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
128128
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
129129
timeout: Duration.minutes(5),
130130
environment: {
@@ -149,8 +149,8 @@ export class Authorization extends Construct {
149149
architecture: Architecture.ARM_64,
150150
runtime: Runtime.NODEJS_20_X,
151151
tracing: Tracing.ACTIVE,
152-
logFormat: LogFormat.JSON,
153-
applicationLogLevel: ApplicationLogLevel.DEBUG,
152+
loggingFormat: LoggingFormat.JSON,
153+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
154154
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
155155
timeout: Duration.minutes(5),
156156
environment: {
@@ -174,8 +174,8 @@ export class Authorization extends Construct {
174174
architecture: Architecture.ARM_64,
175175
runtime: Runtime.NODEJS_20_X,
176176
tracing: Tracing.ACTIVE,
177-
logFormat: LogFormat.JSON,
178-
applicationLogLevel: ApplicationLogLevel.DEBUG,
177+
loggingFormat: LoggingFormat.JSON,
178+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
179179
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
180180
timeout: Duration.minutes(5),
181181
environment: {

lib/data-feed-ingestion/rss-atom-ingestion/data-feed-poll-step-function.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ApplicationLogLevel,
1212
Architecture,
1313
LambdaInsightsVersion,
14-
LogFormat,
14+
LoggingFormat,
1515
Runtime,
1616
Tracing
1717
} from 'aws-cdk-lib/aws-lambda'
@@ -55,8 +55,8 @@ export class DataFeedPollStepFunction extends Construct {
5555
architecture: Architecture.ARM_64,
5656
runtime: Runtime.NODEJS_20_X,
5757
tracing: Tracing.ACTIVE,
58-
logFormat: LogFormat.JSON,
59-
applicationLogLevel: ApplicationLogLevel.DEBUG,
58+
loggingFormat: LoggingFormat.JSON,
59+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
6060
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
6161
environment: {
6262
POWERTOOLS_LOG_LEVEL: 'DEBUG',

lib/data-feed-ingestion/rss-atom-ingestion/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
ApplicationLogLevel,
1515
Architecture,
1616
LambdaInsightsVersion,
17-
LogFormat,
17+
LoggingFormat,
1818
Runtime,
1919
Tracing
2020
} from 'aws-cdk-lib/aws-lambda'
@@ -74,8 +74,8 @@ export class RssAtomFeedConstruct extends Construct {
7474
architecture: Architecture.ARM_64,
7575
runtime: Runtime.NODEJS_20_X,
7676
tracing: Tracing.ACTIVE,
77-
logFormat: LogFormat.JSON,
78-
applicationLogLevel: ApplicationLogLevel.DEBUG,
77+
loggingFormat: LoggingFormat.JSON,
78+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
7979
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
8080
environment: {
8181
POWERTOOLS_LOG_LEVEL: 'DEBUG',

lib/data-feed-ingestion/rss-atom-ingestion/ingestion-step-function.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ApplicationLogLevel,
1212
Architecture,
1313
LambdaInsightsVersion,
14-
LogFormat,
14+
LoggingFormat,
1515
Runtime,
1616
Tracing
1717
} from 'aws-cdk-lib/aws-lambda'
@@ -52,8 +52,8 @@ export class IngestionStepFunction extends Construct {
5252
architecture: Architecture.ARM_64,
5353
runtime: Runtime.NODEJS_20_X,
5454
tracing: Tracing.ACTIVE,
55-
logFormat: LogFormat.JSON,
56-
applicationLogLevel: ApplicationLogLevel.DEBUG,
55+
loggingFormat: LoggingFormat.JSON,
56+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
5757
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
5858
environment: {
5959
POWERTOOLS_LOG_LEVEL: 'DEBUG'
@@ -71,8 +71,8 @@ export class IngestionStepFunction extends Construct {
7171
runtime: Runtime.NODEJS_20_X,
7272
architecture: Architecture.ARM_64,
7373
tracing: Tracing.ACTIVE,
74-
logFormat: LogFormat.JSON,
75-
applicationLogLevel: ApplicationLogLevel.DEBUG,
74+
loggingFormat: LoggingFormat.JSON,
75+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
7676
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
7777
timeout: cdk.Duration.minutes(5),
7878
environment: {
@@ -92,8 +92,8 @@ export class IngestionStepFunction extends Construct {
9292
runtime: Runtime.NODEJS_20_X,
9393
tracing: Tracing.ACTIVE,
9494
architecture: Architecture.ARM_64,
95-
logFormat: LogFormat.JSON,
96-
applicationLogLevel: ApplicationLogLevel.DEBUG,
95+
loggingFormat: LoggingFormat.JSON,
96+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
9797
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
9898
environment: {
9999
NEWS_DATA_INGEST_BUCKET: rssAtomDataBucket.bucketName,

lib/newsletter-generator/index.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
ApplicationLogLevel,
2222
Architecture,
2323
LambdaInsightsVersion,
24-
LogFormat,
24+
LoggingFormat,
2525
Runtime,
2626
Tracing
2727
} from 'aws-cdk-lib/aws-lambda'
@@ -129,9 +129,9 @@ export class NewsletterGenerator extends Construct {
129129
architecture: Architecture.ARM_64,
130130
runtime: Runtime.NODEJS_20_X,
131131
tracing: Tracing.ACTIVE,
132-
logFormat: LogFormat.JSON,
132+
loggingFormat: LoggingFormat.JSON,
133133
logRetention: RetentionDays.ONE_WEEK,
134-
applicationLogLevel: ApplicationLogLevel.DEBUG,
134+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
135135
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
136136
timeout: Duration.minutes(5),
137137
environment: {
@@ -158,9 +158,9 @@ export class NewsletterGenerator extends Construct {
158158
architecture: Architecture.ARM_64,
159159
runtime: Runtime.NODEJS_20_X,
160160
tracing: Tracing.ACTIVE,
161-
logFormat: LogFormat.JSON,
161+
loggingFormat: LoggingFormat.JSON,
162162
logRetention: RetentionDays.ONE_WEEK,
163-
applicationLogLevel: ApplicationLogLevel.DEBUG,
163+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
164164
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
165165
memorySize: 512, // Bumping memory up on this function since it is doing rendering and processing
166166
timeout: Duration.minutes(5),
@@ -215,9 +215,9 @@ export class NewsletterGenerator extends Construct {
215215
architecture: Architecture.ARM_64,
216216
runtime: Runtime.NODEJS_20_X,
217217
tracing: Tracing.ACTIVE,
218-
logFormat: LogFormat.JSON,
218+
loggingFormat: LoggingFormat.JSON,
219219
logRetention: RetentionDays.ONE_WEEK,
220-
applicationLogLevel: ApplicationLogLevel.DEBUG,
220+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
221221
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
222222
timeout: Duration.minutes(5),
223223
environment: {
@@ -256,9 +256,9 @@ export class NewsletterGenerator extends Construct {
256256
architecture: Architecture.ARM_64,
257257
runtime: Runtime.NODEJS_20_X,
258258
tracing: Tracing.ACTIVE,
259-
logFormat: LogFormat.JSON,
259+
loggingFormat: LoggingFormat.JSON,
260260
logRetention: RetentionDays.ONE_WEEK,
261-
applicationLogLevel: ApplicationLogLevel.DEBUG,
261+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
262262
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
263263
timeout: Duration.minutes(5),
264264
environment: {
@@ -278,9 +278,9 @@ export class NewsletterGenerator extends Construct {
278278
architecture: Architecture.ARM_64,
279279
runtime: Runtime.NODEJS_20_X,
280280
tracing: Tracing.ACTIVE,
281-
logFormat: LogFormat.JSON,
281+
loggingFormat: LoggingFormat.JSON,
282282
logRetention: RetentionDays.ONE_WEEK,
283-
applicationLogLevel: ApplicationLogLevel.DEBUG,
283+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
284284
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
285285
timeout: Duration.minutes(5),
286286
environment: {
@@ -317,9 +317,9 @@ export class NewsletterGenerator extends Construct {
317317
architecture: Architecture.ARM_64,
318318
runtime: Runtime.NODEJS_20_X,
319319
tracing: Tracing.ACTIVE,
320-
logFormat: LogFormat.JSON,
320+
loggingFormat: LoggingFormat.JSON,
321321
logRetention: RetentionDays.ONE_WEEK,
322-
applicationLogLevel: ApplicationLogLevel.DEBUG,
322+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
323323
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
324324
timeout: Duration.minutes(5),
325325
environment: {

lib/newsletter-generator/pinpoint-app.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
ApplicationLogLevel,
1919
Architecture,
2020
LambdaInsightsVersion,
21-
LogFormat,
21+
LoggingFormat,
2222
Runtime,
2323
Tracing
2424
} from 'aws-cdk-lib/aws-lambda'
@@ -73,9 +73,9 @@ export class PinpointApp extends Construct {
7373
architecture: Architecture.ARM_64,
7474
runtime: Runtime.NODEJS_20_X,
7575
tracing: Tracing.ACTIVE,
76-
logFormat: LogFormat.JSON,
76+
loggingFormat: LoggingFormat.JSON,
7777
logRetention: RetentionDays.ONE_WEEK,
78-
applicationLogLevel: ApplicationLogLevel.DEBUG,
78+
applicationLogLevelV2: ApplicationLogLevel.DEBUG,
7979
insightsVersion: LambdaInsightsVersion.VERSION_1_0_229_0,
8080
timeout: Duration.minutes(5),
8181
environment: {

0 commit comments

Comments
 (0)