Skip to content

Commit e8a31f0

Browse files
committed
fix: update serverless config to have sparcs prefixes
1 parent 890f6d8 commit e8a31f0

10 files changed

Lines changed: 54 additions & 61 deletions

File tree

.github/workflows/deploy_backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy DurianPy Events Service
1+
name: Deploy SPARCS Events Service
22
on:
33
push:
44
paths:

backend/controller/pycon_registration_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def register_pycon(
7979
'lastName': 'Dela Cruz',
8080
'nickname': 'Juan',
8181
'pronouns': 'he/him',
82-
'email': 'durianpy.davao+juan.delacruz@gmail.com',
82+
'email': 'sparcsup+juan.delacruz@gmail.com',
8383
'eventId': 'pycon-davao-2024',
8484
'contactNumber': '+639171234567',
8585
'organization': 'Tech Company Inc',

backend/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
app = FastAPI(
1414
root_path=root_path,
15-
title='DURIANPY Event Service',
15+
title='SPARCS Event Service',
1616
contact={
1717
'name': 'Society of Programmers and Refined Computer Scientists',
18-
'email': 'contact@durianpy.org',
18+
'email': 'sparcsup@gmail.com',
1919
},
2020
)
2121

backend/resources/api.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app:
1717
path: /docs
1818
method: get
1919
authorizer:
20-
arn: arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:durianpy-auth-service-${self:custom.stage}-basicAuthAuthorizer
20+
arn: arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:sparcs-auth-service-${self:custom.stage}-basicAuthAuthorizer
2121
resultTtlInSeconds: 0
2222
iamRoleStatements:
2323
- Effect: Allow
@@ -31,51 +31,51 @@ app:
3131
Resource:
3232
- { "Fn::GetAtt": [Evaluations, Arn] }
3333
- "Fn::Join":
34-
- "/"
35-
- - "Fn::GetAtt": [ Evaluations, Arn ]
36-
- "index"
37-
- "*"
34+
- "/"
35+
- - "Fn::GetAtt": [Evaluations, Arn]
36+
- "index"
37+
- "*"
3838
- Effect: Allow
3939
Action:
4040
- "dynamodb:*"
4141
Resource:
4242
- { "Fn::GetAtt": [Events, Arn] }
4343
- "Fn::Join":
44-
- "/"
45-
- - "Fn::GetAtt": [ Events, Arn ]
46-
- "index"
47-
- "*"
44+
- "/"
45+
- - "Fn::GetAtt": [Events, Arn]
46+
- "index"
47+
- "*"
4848
- Effect: Allow
4949
Action:
5050
- "dynamodb:*"
5151
Resource:
5252
- { "Fn::GetAtt": [Registrations, Arn] }
5353
- "Fn::Join":
54-
- "/"
55-
- - "Fn::GetAtt": [ Registrations, Arn ]
56-
- "index"
57-
- "*"
54+
- "/"
55+
- - "Fn::GetAtt": [Registrations, Arn]
56+
- "index"
57+
- "*"
5858
- Effect: Allow
5959
Action:
6060
- "dynamodb:*"
6161
Resource:
6262
- { "Fn::GetAtt": [PreRegistrations, Arn] }
6363
- "Fn::Join":
64-
- "/"
65-
- - "Fn::GetAtt": [ PreRegistrations, Arn ]
66-
- "index"
67-
- "*"
64+
- "/"
65+
- - "Fn::GetAtt": [PreRegistrations, Arn]
66+
- "index"
67+
- "*"
6868
- Effect: Allow
6969
Action:
7070
- ssm:GetParameter
7171
Resource:
72-
- arn:aws:ssm:*:*:parameter/durianpy-auth-secret-key-${self:custom.stage}
72+
- arn:aws:ssm:*:*:parameter/sparcs-auth-secret-key-${self:custom.stage}
7373
- Effect: Allow
7474
Action:
7575
- "sqs:*"
7676
Resource:
77-
- !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-durianpy-events-email-queue.fifo
78-
- !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-durianpy-events-certificate-queue.fifo
77+
- !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-sparcs-events-email-queue.fifo
78+
- !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-sparcs-events-certificate-queue.fifo
7979
- Effect: Allow
8080
Action:
8181
- s3:PutObject

backend/resources/functions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ paymentHandler:
2323
events:
2424
- sqs:
2525
arn:
26-
"Fn::GetAtt": [ PaymentQueue, Arn ]
26+
"Fn::GetAtt": [PaymentQueue, Arn]
2727
iamRoleStatements:
2828
- Effect: Allow
2929
Action:
3030
- "sqs:*"
3131
Resource:
32-
- "Fn::GetAtt": [ PaymentQueue, Arn ]
32+
- "Fn::GetAtt": [PaymentQueue, Arn]
3333
- Effect: Allow
3434
Action:
3535
- "dynamodb:PutItem"
@@ -48,4 +48,4 @@ paymentHandler:
4848
- "sqs:SendMessage"
4949
- "sqs:ReceiveMessage"
5050
- "sqs:DeleteMessage"
51-
Resource: "arn:aws:sqs:${self:provider.region}:${aws:accountId}:${self:custom.stage}-durianpy-events-email-queue.fifo"
51+
Resource: "arn:aws:sqs:${self:provider.region}:${aws:accountId}:${self:custom.stage}-sparcs-events-email-queue.fifo"

backend/serverless.yaml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
service: durianpy-events-api
2-
frameworkVersion: '^3.40.0'
1+
service: sparcs-events-api
2+
frameworkVersion: "^3.40.0"
33

44
custom:
5-
projectName: durianpy-events
5+
projectName: sparcs-events
66
serviceName: events
77
stage: ${opt:stage, self:provider.stage}
88
paymentQueue: ${self:custom.stage}-${self:custom.projectName}-payment-queue.fifo
@@ -16,12 +16,9 @@ custom:
1616
# konfHubApiKey: ${ssm:/konfhub/api-key-${self:custom.stage}}
1717
betterCredentials:
1818
enabled: true
19-
emailQueue:
20-
!ImportValue EmailQueue-${self:custom.stage}
21-
certificateQueue:
22-
!ImportValue CertificateQueue-${self:custom.stage}
23-
basicAuthorizerARN:
24-
!ImportValue BasicAuthAuthorizerARN-${self:custom.stage}
19+
emailQueue: !ImportValue EmailQueue-${self:custom.stage}
20+
certificateQueue: !ImportValue CertificateQueue-${self:custom.stage}
21+
basicAuthorizerARN: !ImportValue BasicAuthAuthorizerARN-${self:custom.stage}
2522
pythonRequirements:
2623
dockerizePip: true
2724
usePoetry: false
@@ -30,7 +27,7 @@ custom:
3027
- boto3
3128
- botocore
3229
layer:
33-
name: durianpy-events-${self:custom.stage}-python-requirements
30+
name: sparcs-events-${self:custom.stage}-python-requirements
3431
compatibleRuntimes:
3532
- python3.11
3633
slim: true
@@ -65,16 +62,13 @@ provider:
6562
CERTIFICATE_QUEUE: ${self:custom.certificateQueue}
6663
S3_BUCKET: ${self:custom.bucket}
6764
# KONFHUB_API_KEY: ${self:custom.konfHubApiKey}
68-
USER_POOL_ID:
69-
!ImportValue UserPoolId-${self:custom.stage}
70-
USER_POOL_CLIENT_ID:
71-
!ImportValue AppClientId-${self:custom.stage}
65+
USER_POOL_ID: !ImportValue UserPoolId-${self:custom.stage}
66+
USER_POOL_CLIENT_ID: !ImportValue AppClientId-${self:custom.stage}
7267
SPARCS_GMAIL: sparcsup@gmail.com
7368
logs:
7469
restApi:
7570
role: !GetAtt ApiGatewayCloudWatchRole.Arn
7671

77-
7872
resources:
7973
- ${file(resources/dynamodb.yml)}
8074
- ${file(resources/api_gateway.yml)}
@@ -88,30 +82,29 @@ resources:
8882
AssumeRolePolicyDocument:
8983
Version: "2012-10-17"
9084
Statement:
91-
- Effect: Allow
92-
Principal:
93-
Service: apigateway.amazonaws.com
94-
Action: sts:AssumeRole
85+
- Effect: Allow
86+
Principal:
87+
Service: apigateway.amazonaws.com
88+
Action: sts:AssumeRole
9589
Policies:
9690
- PolicyName: AllowCloudWatchLogs
9791
PolicyDocument:
9892
Version: "2012-10-17"
9993
Statement:
100-
- Effect: Allow
101-
Action:
102-
- logs:CreateLogGroup
103-
- logs:CreateLogStream
104-
- logs:DescribeLogGroups
105-
- logs:DescribeLogStreams
106-
- logs:PutLogEvents
107-
Resource: "*"
94+
- Effect: Allow
95+
Action:
96+
- logs:CreateLogGroup
97+
- logs:CreateLogStream
98+
- logs:DescribeLogGroups
99+
- logs:DescribeLogStreams
100+
- logs:PutLogEvents
101+
Resource: "*"
108102
Outputs:
109103
ApiGatewayCloudWatchRoleArn:
110104
Value: !GetAtt ApiGatewayCloudWatchRole.Arn
111105
Export:
112106
Name: ApiGatewayCloudWatchRole-${self:custom.serviceName}-${self:custom.stage}
113107

114-
115108
functions:
116109
- ${file(resources/api.yml)}
117110
- ${file(resources/functions.yml)}

backend/usecase/certificate_usecase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def generate_certificates(self, event_id: str, registration_id: str = None) -> T
4040
try:
4141
timestamp = datetime.utcnow().isoformat(timespec='seconds')
4242
payload = {'eventId': event_id}
43-
message_group_id = f'durianpy-certificates-{event_id}'
44-
message_dedup_id = f'durianpy-certificates-{event_id}-{timestamp}'
43+
message_group_id = f'sparcs-certificates-{event_id}'
44+
message_dedup_id = f'sparcs-certificates-{event_id}-{timestamp}'
4545

4646
if registration_id:
4747
payload['registrationId'] = registration_id

backend/utils/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from sys import stdout
44

5-
logger = logging.getLogger('durianpy-certificates-service')
5+
logger = logging.getLogger('sparcs-certificates-service')
66
handler = logging.StreamHandler(stdout)
77
if os.getenv('AWS_EXECUTION_ENV'): # pragma: no cover
88
logger.propagate = False

frontend/package-lock.json

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

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "durianpy-techtix",
2+
"name": "sparcs-techtix",
33
"private": true,
44
"version": "0.0.1",
55
"type": "module",

0 commit comments

Comments
 (0)