Skip to content

Commit 46a450a

Browse files
authored
Add message group ID (#228)
1 parent 30ec667 commit 46a450a

File tree

14 files changed

+118
-105
lines changed

14 files changed

+118
-105
lines changed

.github/workflows/deploy-qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ jobs:
130130
- uses: aws-actions/configure-aws-credentials@v4
131131
with:
132132
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
133-
role-session-name: Core_Dev_Deployment_${{ github.run_id }}
133+
role-session-name: Core_QA_Deployment_${{ github.run_id }}
134134
aws-region: us-east-1
135135

136136
- name: Publish to AWS
137-
run: make deploy_dev
137+
run: make deploy_qa
138138
env:
139139
HUSKY: "0"
140140
VITE_RUN_ENVIRONMENT: dev

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: aws-actions/configure-aws-credentials@v4
1515
with:
1616
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
17-
role-session-name: Core_Dev_Deployment
17+
role-session-name: Core_QA_Deployment
1818
aws-region: us-east-1
1919

2020
- name: Get AWS Caller Identity

Makefile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ GIT_HASH := $(shell git rev-parse --short HEAD)
1010

1111
.PHONY: clean
1212

13-
check_account_prod:
14-
ifneq ($(current_aws_account),$(prod_aws_account))
15-
$(error Error: running in account $(current_aws_account), expected account ID $(prod_aws_account))
16-
endif
17-
18-
check_account_dev:
19-
ifneq ($(current_aws_account),$(dev_aws_account))
20-
$(error Error: running in account $(current_aws_account), expected account ID $(dev_aws_account))
21-
endif
22-
2313

2414
clean:
2515
rm -rf .aws-sam
@@ -55,15 +45,19 @@ build: src/
5545
local:
5646
VITE_BUILD_HASH=$(GIT_HASH) yarn run dev
5747

58-
deploy_prod: check_account_prod
48+
deploy_prod:
5949
@echo "Deploying Terraform..."
6050
terraform -chdir=terraform/envs/prod init -lockfile=readonly
61-
terraform -chdir=terraform/envs/prod apply -auto-approve
51+
terraform -chdir=terraform/envs/prod plan -out=tfplan
52+
terraform -chdir=terraform/envs/prod apply -auto-approve tfplan
53+
rm terraform/envs/prod/tfplan
6254

63-
deploy_dev: check_account_dev
55+
deploy_qa:
6456
@echo "Deploying Terraform..."
6557
terraform -chdir=terraform/envs/qa init -lockfile=readonly
66-
terraform -chdir=terraform/envs/qa apply -auto-approve
58+
terraform -chdir=terraform/envs/qa plan -out=tfplan
59+
terraform -chdir=terraform/envs/qa apply -auto-approve tfplan
60+
rm terraform/envs/qa/tfplan
6761

6862
init_terraform:
6963
terraform -chdir=terraform/envs/qa init

src/api/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
2. Enable Tailscale VPN so you can reach the development database in AWS
66
3. Log into AWS with `aws configure sso` so you can retrieve the AWS secret and configuration.
77
4. `yarn -D`
8-
5. `make check_account_dev` - If this fails make sure that AWS is configured.
98
6. `make local`
109

1110
## Build for AWS Lambda
@@ -16,7 +15,7 @@
1615

1716
1. Get AWS credentials with `aws configure sso`
1817
2. Ensure AWS profile is set to the right account (QA or PROD).
19-
3. Run `make deploy_dev` or `make deploy_prod`.
18+
3. Run `make deploy_qa` or `make deploy_prod`.
2019

2120
## Generating JWT token
2221

src/api/routes/apiKey.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ If you did not create this API key, please secure your account and notify the AC
126126
new SendMessageCommand({
127127
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
128128
MessageBody: JSON.stringify(sqsPayload),
129+
MessageGroupId: "securityNotification",
129130
}),
130131
);
131132
if (result.MessageId) {
@@ -228,6 +229,7 @@ If you did not delete this API key, please secure your account and notify the AC
228229
new SendMessageCommand({
229230
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
230231
MessageBody: JSON.stringify(sqsPayload),
232+
MessageGroupId: "securityNotification",
231233
}),
232234
);
233235
if (result.MessageId) {

src/api/routes/membership.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ const membershipPlugin: FastifyPluginAsync = async (fastify, _options) => {
459459
new SendMessageCommand({
460460
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
461461
MessageBody: JSON.stringify(sqsPayload),
462+
MessageGroupId: "membershipProvisioning",
462463
}),
463464
);
464465
if (!result.MessageId) {

src/api/routes/mobileWallet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const mobileWalletRoute: FastifyPluginAsync = async (fastify, _options) => {
7979
new SendMessageCommand({
8080
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
8181
MessageBody: JSON.stringify(sqsPayload),
82+
MessageGroupId: "mobileWalletNotification",
8283
}),
8384
);
8485
if (!result.MessageId) {

src/api/routes/roomRequests.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const roomRequestRoutes: FastifyPluginAsync = async (fastify, _options) => {
160160
new SendMessageCommand({
161161
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
162162
MessageBody: JSON.stringify(sqsPayload),
163+
MessageGroupId: "roomReservationNotification",
163164
}),
164165
);
165166
if (!result.MessageId) {
@@ -388,6 +389,7 @@ const roomRequestRoutes: FastifyPluginAsync = async (fastify, _options) => {
388389
new SendMessageCommand({
389390
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
390391
MessageBody: JSON.stringify(sqsPayload),
392+
MessageGroupId: "roomReservationNotification",
391393
}),
392394
);
393395
if (!result.MessageId) {

src/api/routes/stripe.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ Please ask the payee to try again, perhaps with a different payment method, or c
434434
new SendMessageCommand({
435435
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
436436
MessageBody: JSON.stringify(sqsPayload),
437+
MessageGroupId: "invoiceNotification",
437438
}),
438439
);
439440
queueId = result.MessageId || "";
@@ -588,6 +589,7 @@ Please contact Officer Board with any questions.
588589
new SendMessageCommand({
589590
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
590591
MessageBody: JSON.stringify(sqsPayload),
592+
MessageGroupId: "invoiceNotification",
591593
}),
592594
);
593595
queueId = result.MessageId || "";
@@ -636,6 +638,7 @@ Please contact Officer Board with any questions.`,
636638
new SendMessageCommand({
637639
QueueUrl: fastify.environmentConfig.SqsQueueUrl,
638640
MessageBody: JSON.stringify(sqsPayload),
641+
MessageGroupId: "invoiceNotification",
639642
}),
640643
);
641644
queueId = result.MessageId || "";

terraform/envs/prod/.terraform.lock.hcl

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)