Skip to content

Commit d60df3d

Browse files
committed
Correct hard-coded ParameterStore region: read from env
1 parent f7a5c5d commit d60df3d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cloud/lib/lambdas/verifyAuth/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { CloudFrontRequestEvent, CloudFrontResponse } from 'aws-lambda';
1313
const domainName = process.env.DOMAIN_NAME;
1414
const paramUserPoolId = process.env.PARAM_USERPOOL_ID;
1515
const paramClientId = process.env.PARAM_USERPOOL_CLIENT;
16+
const region = process.env.AWS_REGION;
1617

1718
const inFlightResponse = {
1819
status: '200',
@@ -52,9 +53,7 @@ const retrieveParameters = async () => {
5253
throw new Error('Userpool param names not found in ENV!');
5354
}
5455

55-
const { Parameters: params } = await new SSMClient({
56-
region: 'eu-north-1',
57-
}).send(
56+
const { Parameters: params } = await new SSMClient({ region }).send(
5857
new GetParametersCommand({
5958
Names: [paramUserPoolId, paramClientId],
6059
})

cloud/lib/scheduler-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class SchedulerStack extends Stack {
4949
generateResourceId('fargate-switch'),
5050
{
5151
description: generateResourceDescription('Fargate Service start/stop function'),
52-
runtime: Runtime.NODEJS_18_X,
52+
runtime: Runtime.NODEJS_20_X,
5353
handler: 'handler',
5454
entry: join(__dirname, 'lambdas/startStopService.ts'),
5555
bundling: {

cloud/lib/ui-stack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,17 @@ export class UiStack extends Stack {
101101
stackId: stackName(scope)('edge-lambda'),
102102
functionName: edgeFunctionName,
103103
handler: 'index.handler',
104-
runtime: Runtime.NODEJS_18_X,
104+
runtime: Runtime.NODEJS_20_X,
105105
code: new TypeScriptCode(join(__dirname, 'lambdas/verifyAuth/index.ts'), {
106106
buildOptions: {
107107
bundle: true,
108108
external: ['@aws-sdk/client-ssm'],
109109
minify: false,
110110
platform: 'node',
111-
target: 'node18',
111+
target: 'node20',
112112
define: {
113113
'process.env.DOMAIN_NAME': `"${domainName}"`,
114+
'process.env.AWS_REGION': `"${env.region}"`,
114115
'process.env.PARAM_USERPOOL_ID': `"${parameterNameUserPoolId}"`,
115116
'process.env.PARAM_USERPOOL_CLIENT': `"${parameterNameUserPoolClient}"`,
116117
},

cloud/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2022",
44
"module": "commonjs",
5-
"lib": ["es2020", "dom"],
5+
"lib": ["es2022", "dom"],
66
"declaration": true,
77
"strict": true,
88
"noImplicitAny": true,

0 commit comments

Comments
 (0)