Skip to content

Commit 54a2afb

Browse files
committed
updates
1 parent 2a456b7 commit 54a2afb

File tree

7 files changed

+23
-7
lines changed

7 files changed

+23
-7
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ build: src/ cloudformation/
6767
cp -r src/api/resources/ dist/api/resources
6868
rm -rf dist/lambda/sqs
6969
sam build --template-file cloudformation/main.yml --use-container --parallel
70+
npm --prefix=dist/lambda/ i --cpu arm64 --os linux
71+
npm --prefix=dist/sqsConsumer/ i --cpu arm64 --os linux
7072
mkdir -p .aws-sam/build/AppApiLambdaFunction/node_modules/aws-crt/
7173
cp -r node_modules/aws-crt/dist .aws-sam/build/AppApiLambdaFunction/node_modules/aws-crt
7274
## IF WE EVER CHANGE THE LAMBDA ARCH, BE SURE TO CHANGE THESE ##
@@ -80,6 +82,17 @@ build: src/ cloudformation/
8082
rm -rf .aws-sam/build/AppApiLambdaFunction/node_modules/argon2/prebuilds/win32-x64*
8183
rm -rf .aws-sam/build/AppApiLambdaFunction/node_modules/argon2/prebuilds/linux-arm64/argon2.armv8.musl.node
8284

85+
## NEW
86+
rm -rf dist/lambda/node_modules/aws-crt/dist/bin/darwin*
87+
rm -rf dist/lambda/node_modules/aws-crt/dist/bin/linux-x64*
88+
rm -rf dist/lambda/node_modules/aws-crt/dist/bin/linux-arm64-musl
89+
rm -rf dist/lambda/node_modules/argon2/prebuilds/darwin*
90+
rm -rf dist/lambda/node_modules/argon2/prebuilds/freebsd*
91+
rm -rf dist/lambda/node_modules/argon2/prebuilds/linux-arm
92+
rm -rf dist/lambda/node_modules/argon2/prebuilds/linux-x64*
93+
rm -rf dist/lambda/node_modules/argon2/prebuilds/win32-x64*
94+
rm -rf dist/lambda/node_modules/argon2/prebuilds/linux-arm64/argon2.armv8.musl.node
95+
8396
local:
8497
VITE_BUILD_HASH=$(GIT_HASH) yarn run dev
8598

src/api/createLambdaPackage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const packagesToTransfer = [
1919
"@fastify/swagger",
2020
"zod-openapi",
2121
"zod",
22+
"aws-crt",
2223
];
2324
const filePath = `${getPath().dirname}/package.json`;
2425
const writeFilePath = `${getPath().dirname}/package.lambda.json`;

src/api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@middy/sqs-partial-batch-failure": "^6.1.6",
3737
"@touch4it/ical-timezones": "^1.9.0",
3838
"argon2": "^0.43.0",
39+
"aws-crt": "^1.27.3",
3940
"base64-arraybuffer": "^1.0.2",
4041
"discord.js": "^14.19.1",
4142
"dotenv": "^16.5.0",
@@ -71,4 +72,4 @@
7172
"pino-pretty": "^13.0.0",
7273
"yaml": "^2.8.0"
7374
}
74-
}
75+
}

terraform/envs/qa/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ module "dynamo" {
4545
ProjectId = var.ProjectId
4646
}
4747

48-
resource "random_string" "origin_verify_key" {
49-
length = 16
48+
resource "random_password" "origin_verify_key" {
49+
length = 20
5050
special = false
5151
keepers = {
5252
force_recreation = uuid()
@@ -59,7 +59,7 @@ module "lambdas" {
5959
RunEnvironment = "dev"
6060
EntraRoleArn = "arn:aws:iam::427040638965:role/infra-core-api-AppSecurityRoles--EntraLambdaIAMRole-b3CFiiF0S5pN"
6161
LinkryKvArn = "arn:aws:cloudfront::427040638965:key-value-store/0c2c02fd-7c47-4029-975d-bc5d0376bba1"
62-
OriginVerifyKey = random_string.origin_verify_key.result
62+
OriginVerifyKey = random_password.origin_verify_key.result
6363
LogRetentionDays = 30
6464
}
6565

terraform/modules/lambdas/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ resource "aws_iam_policy" "shared_iam_policy" {
4545
{
4646
Action = ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"],
4747
Effect = "Allow",
48-
Resource = [aws_cloudwatch_log_group.api_logs.arn]
48+
Resource = ["${aws_cloudwatch_log_group.api_logs.arn}:*"]
4949
},
5050
{
5151
Action = ["secretsmanager:GetSecretValue"],

terraform/modules/lambdas/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ variable "RunEnvironment" {
2222
}
2323

2424
variable "OriginVerifyKey" {
25-
type = string
25+
type = string
26+
sensitive = true
2627
}
2728

2829
variable "LogRetentionDays" {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3879,7 +3879,7 @@ avvio@^9.0.0:
38793879
"@fastify/error" "^4.0.0"
38803880
fastq "^1.17.1"
38813881

3882-
aws-crt@^1.24.0:
3882+
aws-crt@^1.24.0, aws-crt@^1.27.3:
38833883
version "1.27.3"
38843884
resolved "https://registry.yarnpkg.com/aws-crt/-/aws-crt-1.27.3.tgz#a48b1baf0e3ad9985f8b0be575b9723915e28c47"
38853885
integrity sha512-LPVCX4If8nAy1OERzmFx/pVr4g6olBqbz30SoLTkVJu5m5WH5GkhbIKnucQ1e5ZbpfNh+nrsFM2dolXO8ow4PQ==

0 commit comments

Comments
 (0)