Skip to content

Commit

Permalink
Revert "Remove serverless resources"
Browse files Browse the repository at this point in the history
This reverts commit 1ccb61d.
  • Loading branch information
aloftus23 committed Dec 11, 2024
1 parent d5d722b commit 578b4a4
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
49 changes: 49 additions & 0 deletions backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,55 @@ provider:
- ssm:PutParameter
Resource: '*'

resources:
Resources:
ShodanQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-shodan-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days
DnstwistQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-dnstwist-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days
IntelxQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-intelx-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days
CybersixgillQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-cybersixgill-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days
XpanseQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-xpanse-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days
ASMQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:provider.stage}-asm-queue
VisibilityTimeout: 18000 # 5 hours
MaximumMessageSize: 262144 # 256 KB
MessageRetentionPeriod: 604800 # 7 days

functions:
- ${file(./src/tasks/functions.yml)}
- ${file(./src/api/functions.yml)}

plugins:
- serverless-domain-manager
- serverless-dotenv-plugin
13 changes: 13 additions & 0 deletions backend/src/api/functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
api:
handler: src/api.handler
events:
- http:
path: / # this matches the base path
method: ANY
cors: true
- http:
# this matches any path, the token 'any' doesn't mean anything special
path: /{any+}
method: ANY
cors: true
60 changes: 60 additions & 0 deletions backend/src/tasks/functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
cloudwatchToS3:
handler: src/tasks/cloudwatchToS3.handler
timeout: 900
events:
- schedule: rate(4 hours)
reservedConcurrency: 1
memorySize: 4096

scheduler:
handler: src/tasks/scheduler.handler
timeout: 900
events:
- schedule: rate(5 minutes)
reservedConcurrency: 1
memorySize: 4096

syncdb:
timeout: 900
handler: src/tasks/syncdb.handler

pesyncdb:
timeout: 900
handler: src/tasks/pesyncdb.handler

syncmdl:
timeout: 900
handler: src/tasks/syncmdl.handler

bastion:
timeout: 900
handler: src/tasks/bastion.handler

makeGlobalAdmin:
handler: src/tasks/makeGlobalAdmin.handler

checkUserExpiration:
timeout: 300
handler: src/tasks/checkUserExpiration.handler
events:
- schedule: cron(0 0 * * ? *) # Runs every day at midnight

scanExecution:
timeout: 900 # 15 minutes
handler: src/tasks/scanExecution.handler
memorySize: 4096

updateScanTaskStatus:
handler: src/tasks/updateScanTaskStatus.handler
events:
- eventBridge:
name: ${self:provider.stage}-updateScanTaskStatus
pattern:
source:
- aws.ecs
detail-type:
- ECS Task State Change
detail:
clusterArn:
- ${file(env.yml):${self:provider.stage}-ecs-cluster, ''}

0 comments on commit 578b4a4

Please sign in to comment.