Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
Closes #363
Closes #362
Closes #361
Closes #360
Closes #353
Closes #351
Closes #350
Closes #347
Closes #346
Closes #345
Closes #344
  • Loading branch information
coderbyheart committed Nov 24, 2024
1 parent 510a496 commit a3133b9
Show file tree
Hide file tree
Showing 11 changed files with 4,687 additions and 5,236 deletions.
12 changes: 6 additions & 6 deletions cdk/BackendStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ export class BackendStack extends Stack {
layerVersionName: `${Stack.of(this).stackName}-baseLayer`,
code: new LambdaSource(this, {
id: 'baseLayer',
zipFile: layer.layerZipFile,
zipFilePath: layer.layerZipFilePath,
hash: layer.hash,
}).code,
compatibleArchitectures: [Lambda.Architecture.ARM_64],
compatibleRuntimes: [Lambda.Runtime.NODEJS_20_X],
compatibleRuntimes: [Lambda.Runtime.NODEJS_22_X],
})

const jwtLayerVersion = new Lambda.LayerVersion(this, 'jwtLayer', {
layerVersionName: `${Stack.of(this).stackName}-jwtLayer`,
code: new LambdaSource(this, {
id: 'jwtLayer',
zipFile: jwtLayer.layerZipFile,
zipFilePath: jwtLayer.layerZipFilePath,
hash: jwtLayer.hash,
}).code,
compatibleArchitectures: [Lambda.Architecture.ARM_64],
compatibleRuntimes: [Lambda.Runtime.NODEJS_20_X],
compatibleRuntimes: [Lambda.Runtime.NODEJS_22_X],
})

const publicDevices = new PublicDevices(this)
Expand Down Expand Up @@ -112,11 +112,11 @@ export class BackendStack extends Stack {
const cdkLayerVersion = new Lambda.LayerVersion(this, 'cdkLayer', {
code: new LambdaSource(this, {
id: 'cdkLayer',
zipFile: cdkLayer.layerZipFile,
zipFilePath: cdkLayer.layerZipFilePath,
hash: cdkLayer.hash,
}).code,
compatibleArchitectures: [Lambda.Architecture.ARM_64],
compatibleRuntimes: [Lambda.Runtime.NODEJS_20_X],
compatibleRuntimes: [Lambda.Runtime.NODEJS_22_X],
})
const domain = new CustomDomain(this, {
api,
Expand Down
2 changes: 1 addition & 1 deletion cdk/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IAMClient } from '@aws-sdk/client-iam'
import { ensureGitHubOIDCProvider } from '@bifravst/ci'
import { fromEnv } from '@bifravst/from-env'
import { getCertificateArnForDomain } from '../aws/acm.js'
import pJSON from '../package.json'
import pJSON from '../package.json' assert { type: 'json' }
import { BackendApp } from './BackendApp.js'
import { pack as packBaseLayer } from './baseLayer.js'
import { pack as packCDKLayer } from './cdkLayer.js'
Expand Down
2 changes: 1 addition & 1 deletion cdk/baseLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
packLayer,
type PackedLayer,
} from '@bifravst/aws-cdk-lambda-helpers/layer'
import type pJson from '../package.json'
import pJson from '../package.json' assert { type: 'json' }

const dependencies: Array<keyof (typeof pJson)['dependencies']> = [
'@bifravst/from-env',
Expand Down
2 changes: 1 addition & 1 deletion cdk/cdkLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
packLayer,
type PackedLayer,
} from '@bifravst/aws-cdk-lambda-helpers/layer'
import type pJson from '../package.json'
import pJson from '../package.json' assert { type: 'json' }

const dependencies: Array<keyof (typeof pJson)['devDependencies']> = [
'cfn-response',
Expand Down
2 changes: 1 addition & 1 deletion cdk/jwtLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
packLayer,
type PackedLayer,
} from '@bifravst/aws-cdk-lambda-helpers/layer'
import type pJson from '../package.json'
import pJson from '../package.json' assert { type: 'json' }

const dependencies: Array<keyof (typeof pJson)['dependencies']> = [
'jsonwebtoken',
Expand Down
11 changes: 6 additions & 5 deletions cdk/packBackendLambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export type BackendLambdas = {
notifyAboutExpiringDevices: PackedLambda
}

const pack = async (id: string) => packLambdaFromPath(id, `lambda/${id}.ts`)
const pack = async (id: string) =>
packLambdaFromPath({ id, sourceFilePath: `lambda/${id}.ts` })

export const packBackendLambdas = async (): Promise<BackendLambdas> => ({
shareDevice: await pack('shareDevice'),
Expand All @@ -31,10 +32,10 @@ export const packBackendLambdas = async (): Promise<BackendLambdas> => ({
extendDeviceSharing: await pack('extendDeviceSharing'),
openSSL: await pack('openSSL'),
apiHealthCheck: await pack('apiHealthCheck'),
createCNAMERecord: await packLambdaFromPath(
'createCNAMERecord',
'cdk/resources/api/createCNAMERecord.ts',
),
createCNAMERecord: await packLambdaFromPath({
id: 'createCNAMERecord',
sourceFilePath: 'cdk/resources/api/createCNAMERecord.ts',
}),
jwks: await pack('jwks'),
deviceJwt: await pack('deviceJwt'),
requestToken: await pack('requestToken'),
Expand Down
4 changes: 2 additions & 2 deletions cdk/resources/api/HealthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export class ApiHealthCheck extends Construct {
this.fn = new Lambda.Function(this, 'fn', {
handler: lambdaSources.apiHealthCheck.handler,
architecture: Lambda.Architecture.ARM_64,
runtime: Lambda.Runtime.NODEJS_20_X,
runtime: Lambda.Runtime.NODEJS_22_X,
timeout: Duration.seconds(1),
memorySize: 1792,
code: Lambda.Code.fromAsset(lambdaSources.apiHealthCheck.zipFile),
code: Lambda.Code.fromAsset(lambdaSources.apiHealthCheck.zipFilePath),
description: 'Simple health-check resource.',
layers: [baseLayer],
environment: {
Expand Down
12 changes: 6 additions & 6 deletions cdk/resources/containers/buildOpenSSLLambdaImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { logFn } from '../../../cli/log.js'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

import pJSON from '../../../package.json'
import pJSON from '../../../package.json' assert { type: 'json' }

export const buildOpenSSLLambdaImage = async (
builder: ImageBuilder,
Expand All @@ -26,10 +26,10 @@ export const buildOpenSSLLambdaImage = async (
): Promise<string> => {
const dockerFilePath = path.join(__dirname, 'openssl-lambda')

const { zipFile, hash } = await packLambdaFromPath(
'openSSL',
'lambda/openSSL.ts',
)
const { zipFilePath, hash } = await packLambdaFromPath({
id: 'openSSL',
sourceFilePath: 'lambda/openSSL.ts',
})

const tag = checkSumOfStrings([
await hashFolder(dockerFilePath),
Expand All @@ -52,7 +52,7 @@ export const buildOpenSSLLambdaImage = async (

await run({
command: 'unzip',
args: ['-o', zipFile, '-d', path.join(distDir, 'lambda')],
args: ['-o', zipFilePath, '-d', path.join(distDir, 'lambda')],
log: { debug, stderr: debug, stdout: debug },
})

Expand Down
2 changes: 1 addition & 1 deletion cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { program } from 'commander'
import { env } from '../aws/env.js'
import type { StackOutputs } from '../cdk/BackendStack.js'
import { STACK_NAME } from '../cdk/stackConfig.js'
import psjon from '../package.json'
import psjon from '../package.json' assert { type: 'json' }
import type { CommandDefinition } from './commands/CommandDefinition.js'
import { buildContainersCommand } from './commands/build-container.js'
import { configureHelloCommand } from './commands/configure-hello.js'
Expand Down
Loading

0 comments on commit a3133b9

Please sign in to comment.