Skip to content

Commit 34a6698

Browse files
authored
Merge branch 'stage' into 52-betechtix-add-multi-usage-discount-codes-feature
2 parents a023b70 + 623fb22 commit 34a6698

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

.github/workflows/deploy_backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ jobs:
6464
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
6565
sls deploy --stage prod --verbose
6666
elif [[ "${{ github.ref }}" == "refs/heads/stage" ]]; then
67-
sls deploy --stage dev --verbose
67+
sls deploy --stage staging --verbose
6868
fi
6969
working-directory: backend

backend/model/pycon_registrations/pycon_registration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ class PyconRegistration(BaseModel):
4141
contactNumber: str = Field(..., title='Contact Number')
4242
organization: str = Field(..., title='Affiliated Company or Organization')
4343
jobTitle: str = Field(..., title='Job Title', description='Your current job title or role in tech')
44-
4544
socials: Optional[SocialMedia] = Field(
4645
None, title='Social Media Profiles', description='Links to your social media profiles'
4746
)
48-
4947
ticketType: TicketTypes = Field(title='Ticket Type', description='Type of ticket you are registering for')
5048
sprintDay: bool = Field(
5149
..., title='Sprint Day Participation', description='Will you be participating in the sprint day?'
@@ -155,3 +153,6 @@ class PyconRegistrationIn(PyconRegistration):
155153
referenceNumber = UnicodeAttribute(null=True)
156154
amountPaid = NumberAttribute(null=True)
157155
transactionId = UnicodeAttribute(null=True)
156+
157+
class Config:
158+
arbitrary_types_allowed = True

backend/serverless.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,46 @@ provider:
7171
!ImportValue AppClientId-${self:custom.stage}
7272
SPARCS_GMAIL: sparcsup@gmail.com
7373
logs:
74-
restApi: true
74+
restApi:
75+
role: !GetAtt ApiGatewayCloudWatchRole.Arn
76+
7577

7678
resources:
7779
- ${file(resources/dynamodb.yml)}
7880
- ${file(resources/api_gateway.yml)}
7981
- ${file(resources/s3.yml)}
8082
- ${file(resources/sqs.yml)}
83+
- Resources:
84+
ApiGatewayCloudWatchRole:
85+
Type: AWS::IAM::Role
86+
Properties:
87+
RoleName: serverlessApiGatewayCloudWatchRole-${self:custom.serviceName}-${self:custom.stage}
88+
AssumeRolePolicyDocument:
89+
Version: "2012-10-17"
90+
Statement:
91+
- Effect: Allow
92+
Principal:
93+
Service: apigateway.amazonaws.com
94+
Action: sts:AssumeRole
95+
Policies:
96+
- PolicyName: AllowCloudWatchLogs
97+
PolicyDocument:
98+
Version: "2012-10-17"
99+
Statement:
100+
- Effect: Allow
101+
Action:
102+
- logs:CreateLogGroup
103+
- logs:CreateLogStream
104+
- logs:DescribeLogGroups
105+
- logs:DescribeLogStreams
106+
- logs:PutLogEvents
107+
Resource: "*"
108+
Outputs:
109+
ApiGatewayCloudWatchRoleArn:
110+
Value: !GetAtt ApiGatewayCloudWatchRole.Arn
111+
Export:
112+
Name: ApiGatewayCloudWatchRole-${self:custom.serviceName}-${self:custom.stage}
113+
81114

82115
functions:
83116
- ${file(resources/api.yml)}

0 commit comments

Comments
 (0)