Skip to content

Commit 11f2d98

Browse files
committed
Merged sig-details-api
1 parent 36eadf2 commit 11f2d98

File tree

110 files changed

+11014
-1907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+11014
-1907
lines changed

.devcontainer/devcontainer.json

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33
{
4-
"name": "Ubuntu",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
7-
"features": {
8-
"ghcr.io/devcontainers/features/node:1": {},
4+
"name": "Ubuntu",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
7+
"features": {
8+
"ghcr.io/devcontainers/features/node:1": {},
99
"ghcr.io/devcontainers/features/aws-cli:1": {},
10-
"ghcr.io/jungaretti/features/make:1": {},
11-
"ghcr.io/customink/codespaces-features/sam-cli:1": {},
12-
"ghcr.io/devcontainers/features/python:1": {}
13-
},
10+
"ghcr.io/jungaretti/features/make:1": {},
11+
"ghcr.io/customink/codespaces-features/sam-cli:1": {},
12+
"ghcr.io/devcontainers/features/python:1": {},
13+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
14+
},
1415

15-
// Features to add to the dev container. More info: https://containers.dev/features.
16-
// "features": {},
16+
// Features to add to the dev container. More info: https://containers.dev/features.
17+
// "features": {},
1718

18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
"forwardPorts": [
20-
8080,
21-
5173
22-
],
23-
"customizations": {
24-
"vscode": {
25-
"extensions": [
26-
"EditorConfig.EditorConfig",
27-
"waderyan.gitblame",
28-
"Gruntfuggly.todo-tree"
29-
]
30-
}
31-
}
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
"forwardPorts": [8080, 5173],
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"EditorConfig.EditorConfig",
25+
"waderyan.gitblame",
26+
"Gruntfuggly.todo-tree"
27+
]
28+
}
29+
}
3230

33-
// Use 'postCreateCommand' to run commands after the container is created.
34-
// "postCreateCommand": "uname -a",
31+
// Use 'postCreateCommand' to run commands after the container is created.
32+
// "postCreateCommand": "uname -a",
3533

36-
// Configure tool-specific properties.
37-
// "customizations": {},
34+
// Configure tool-specific properties.
35+
// "customizations": {},
3836

39-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
40-
// "remoteUser": "root"
37+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
38+
// "remoteUser": "root"
4139
}

.github/workflows/deploy-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- uses: aws-actions/configure-aws-credentials@v4
8282
with:
8383
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
84-
role-session-name: Core_Dev_Deployment
84+
role-session-name: Core_Dev_Deployment_${{ github.run_id }}
8585
aws-region: us-east-1
8686

8787
- name: Publish to AWS

.github/workflows/deploy-prod.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: actions/setup-node@v4
4343
with:
4444
node-version: 22.x
45+
4546
- uses: actions/checkout@v4
4647
env:
4748
HUSKY: "0"
@@ -55,7 +56,7 @@ jobs:
5556
- uses: aws-actions/configure-aws-credentials@v4
5657
with:
5758
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
58-
role-session-name: Core_Dev_Prod_Deployment
59+
role-session-name: Core_Dev_Prod_Deployment_${{ github.run_id }}
5960
aws-region: us-east-1
6061
- name: Publish to AWS
6162
run: make deploy_dev
@@ -90,6 +91,7 @@ jobs:
9091
uses: actions/setup-node@v4
9192
with:
9293
node-version: 22.x
94+
9395
- uses: actions/checkout@v4
9496
env:
9597
HUSKY: "0"
@@ -103,7 +105,7 @@ jobs:
103105
- uses: aws-actions/configure-aws-credentials@v4
104106
with:
105107
role-to-assume: arn:aws:iam::298118738376:role/GitHubActionsRole
106-
role-session-name: Core_Dev_Prod_Deployment
108+
role-session-name: Core_Dev_Prod_Deployment_${{ github.run_id }}
107109
aws-region: us-east-1
108110
- name: Publish to AWS
109111
run: make deploy_prod

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,4 @@ __pycache__
142142
/blob-report/
143143
/playwright/.cache/
144144
dist_devel/
145+
!src/ui/pages/logs

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ build: src/ cloudformation/ docs/
5858
VITE_BUILD_HASH=$(GIT_HASH) yarn build
5959
cp -r src/api/resources/ dist/api/resources
6060
rm -rf dist/lambda/sqs
61-
sam build --template-file cloudformation/main.yml
61+
sam build --template-file cloudformation/main.yml --use-container
62+
mkdir -p .aws-sam/build/AppApiLambdaFunction/node_modules/aws-crt/
63+
cp -r node_modules/aws-crt/dist .aws-sam/build/AppApiLambdaFunction/node_modules/aws-crt
6264

6365
local:
6466
VITE_BUILD_HASH=$(GIT_HASH) yarn run dev
@@ -80,7 +82,7 @@ deploy_dev: check_account_dev build
8082
invalidate_cloudfront:
8183
@echo "Creating CloudFront invalidation..."
8284
$(eval DISTRIBUTION_ID := $(shell aws cloudformation describe-stacks --stack-name $(application_key) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontDistributionId'].OutputValue" --output text))
83-
$(eval DISTRIBUTION_ID_2 := $(shell aws cloudformation describe-stacks --stack-name $(application_key) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontSecondaryDistributionId'].OutputValue" --output text))
85+
$(eval DISTRIBUTION_ID_2 := $(shell aws cloudformation describe-stacks --stack-name $(application_key) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontIcalDistributionId'].OutputValue" --output text))
8486
$(eval INVALIDATION_ID := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID) --paths "/*" --query 'Invalidation.Id' --output text --no-cli-page))
8587
$(eval INVALIDATION_ID_2 := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID_2) --paths "/*" --query 'Invalidation.Id' --output text --no-cli-page))
8688
@echo "Waiting on job $(INVALIDATION_ID)..."

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ This repository is split into multiple parts:
77
## Getting Started
88
You will need node>=22 installed, as well as the AWS CLI and the AWS SAM CLI. The best way to work with all of this is to open the environment in a container within your IDE (VS Code should prompt you to do so: use "Clone in Container" for best performance). This container will have all needed software installed.
99

10-
Then, run `make install` to install all packages, and `make local` to start the UI and API servers! The UI will be accessible on `http://localhost:5173/` and the API on `http://localhost:8080/`.
10+
Then, run `make install` to install all packages, and `make local` to start the UI and API servers! The UI will be accessible on `http://localhost:5173/` and the API on `http://localhost:8080/`.

cloudformation/iam.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Parameters:
1515
Type: String
1616
SqsQueueArn:
1717
Type: String
18+
LinkryKvArn:
19+
Type: String
1820

1921
Conditions:
2022
IsDev: !Equals [!Ref RunEnvironment, "dev"]
@@ -74,12 +76,15 @@ Resources:
7476
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-membership-external
7577
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-room-requests
7678
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-room-requests-status
79+
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-linkry
80+
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-keys
7781
# Index accesses
7882
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-stripe-links/index/*
7983
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-events/index/*
8084
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-merchstore-purchase-history/index/*
8185
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-room-requests/index/*
8286
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-room-requests-status/index/*
87+
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-linkry/index/*
8388

8489
- Sid: DynamoDBCacheAccess
8590
Effect: Allow
@@ -102,6 +107,16 @@ Resources:
102107
Resource:
103108
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-rate-limiter
104109

110+
- Sid: DynamoDBAuditLogTableAccess
111+
Effect: Allow
112+
Action:
113+
- dynamodb:DescribeTable
114+
- dynamodb:PutItem
115+
- dynamodb:Query
116+
Resource:
117+
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-audit-log
118+
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-audit-log/index/*
119+
105120
- Sid: DynamoDBStreamAccess
106121
Effect: Allow
107122
Action:
@@ -112,6 +127,12 @@ Resources:
112127
Resource:
113128
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-stripe-links/stream/*
114129
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-events/stream/*
130+
- Sid: CloudfrontKvStreamAccess
131+
Effect: Allow
132+
Action:
133+
- cloudfront-keyvaluestore:*
134+
Resource:
135+
- !Ref LinkryKvArn
115136

116137
# API Lambda IAM Role
117138
ApiLambdaIAMRole:
@@ -176,6 +197,7 @@ Resources:
176197
Effect: Allow
177198
Resource:
178199
- Fn::Sub: arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:infra-core-api-entra*
200+
- Fn::Sub: arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:infra-core-api-ro-entra*
179201

180202
# SQS Lambda IAM Role
181203
SqsLambdaIAMRole:

cloudformation/logs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,26 @@ Resources:
2121
LogGroupName:
2222
Fn::Sub: /aws/lambda/${LambdaFunctionName}-edge
2323
RetentionInDays: 7
24+
AppAuditLog:
25+
Type: "AWS::DynamoDB::Table"
26+
DeletionPolicy: "Retain"
27+
UpdateReplacePolicy: "Retain"
28+
Properties:
29+
BillingMode: "PAY_PER_REQUEST"
30+
TableName: infra-core-api-audit-log
31+
DeletionProtectionEnabled: true
32+
PointInTimeRecoverySpecification:
33+
PointInTimeRecoveryEnabled: true
34+
AttributeDefinitions:
35+
- AttributeName: module
36+
AttributeType: S
37+
- AttributeName: createdAt
38+
AttributeType: N
39+
KeySchema:
40+
- AttributeName: module
41+
KeyType: HASH
42+
- AttributeName: createdAt
43+
KeyType: RANGE
44+
TimeToLiveSpecification:
45+
AttributeName: expiresAt
46+
Enabled: true

0 commit comments

Comments
 (0)