SHARE
TWEET

Untitled

a guest Sep 16th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. service: stingrayai
  2.  
  3. custom:
  4.   allVpcSettings:
  5.     dev:
  6.       vpc:
  7.         securityGroupIds: []
  8.         subnetIds: []
  9.     prod:
  10.       vpc:
  11.         securityGroupIds:
  12.           - ${ssm:/stingrayai/${opt:stage, 'dev'}/SECURITY_GROUP_IDS~true}
  13.         subnetIds:
  14.           "Fn::Split":
  15.             - ","
  16.             - ${ssm:/stingrayai/${opt:stage, 'dev'}/SUBNET_IDS~true}
  17. provider:
  18.   name: aws
  19.   runtime: nodejs10.x
  20.   memorySize: 128
  21.   timeout: 30
  22.   stage: ${opt:stage, 'dev'}
  23.   region: us-east-1
  24.   vpc: ${self:custom.allVpcSettings.${self:provider.stage}.vpc}
  25.   environment:
  26.     DB: ${ssm:/stingrayai/${self:provider.stage}/DB~true}
  27.     JWT_SECRET: ${ssm:/stingrayai/${self:provider.stage}/JWT_SECRET~true}
  28.     API_ARN: ${ssm:/stingrayai/${self:provider.stage}/API_ARN~true}
  29.     SENDGRID_API_KEY: ${ssm:/stingrayai/${self:provider.stage}/SENDGRID_API_KEY~true}
  30.     EMAIL_FROM: ${ssm:/stingrayai/${self:provider.stage}/EMAIL_FROM~true}
  31.     FRONTEND_DOMAIN: ${ssm:/stingrayai/${self:provider.stage}/FRONTEND_DOMAIN~true}
  32.     STAGE: ${self:provider.stage}
  33.   iamRoleStatements:
  34.     - Effect: 'Allow'
  35.       Action:
  36.         - s3:PutObject
  37.         - s3:PutObjectAcl
  38.       Resource:
  39.         - 'arn:aws:s3:::stingrayai-${self:provider.stage}-avatars/*.jpg'
  40.         - 'arn:aws:s3:::stingrayai-${self:provider.stage}-avatars/*.jpeg'
  41.         - 'arn:aws:s3:::stingrayai-${self:provider.stage}-avatars/*.png'
  42.     - Effect: 'Allow'
  43.       Action:
  44.         - s3:PutBucketCORS
  45.         - s3:PutBucketPublicAccessBlock
  46.         - s3:CreateBucket
  47.         - s3:ListBucket
  48.       Resource:
  49.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*'
  50.     - Effect: 'Allow'
  51.       Action:
  52.         - s3:DeleteObject
  53.         - s3:putObject
  54.       Resource:
  55.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*/*.doc'
  56.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*/*.docx'
  57.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*/*.pdf'
  58.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*/*.txt'
  59.         - 'arn:aws:s3:::stingray-client-${self:provider.stage}-*/*.csv'
  60. functions:
  61.   verify-token:
  62.     handler: auth/VerifyToken.auth
  63.  
  64.   login:
  65.     handler: auth/AuthHandler.login
  66.     events:
  67.       - http:
  68.           path: login
  69.           method: post
  70.           cors: true
  71.   # verification:
  72.   #   handler: auth/AuthHandler.verification
  73.   #   events:
  74.   #     - http:
  75.   #         path: verification
  76.   #         method: post
  77.   #         cors: true
  78.   # register:
  79.   #   handler: auth/AuthHandler.register
  80.   #   events:
  81.   #     - http:
  82.   #         path: register
  83.   #         method: post
  84.   #         cors: true
  85.   # forgotPassword:
  86.   #   handler: auth/AuthHandler.forgotPassword
  87.   #   events:
  88.   #     - http:
  89.   #         path: forgotPassword
  90.   #         method: post
  91.   #         cors: true
  92.   # resetPassword:
  93.   #   handler: auth/AuthHandler.resetPassword
  94.   #   events:
  95.   #     - http:
  96.   #         path: resetPassword
  97.   #         method: post
  98.   #         cors: true
  99.   groups:
  100.     handler: controllers/GroupsHandler.main
  101.     events:
  102.       - http:
  103.           path: groups
  104.           method: any
  105.           cors: true
  106.           authorizer: verify-token
  107.       - http:
  108.           path: groups/{id}
  109.           method: any
  110.           cors: true
  111.           authorizer: verify-token
  112.   company:
  113.     handler: controllers/CompanyHandler.main
  114.     events:
  115.       - http:
  116.           path: company
  117.           method: any
  118.           cors: true
  119.           authorizer: verify-token
  120.   licence:
  121.     handler: controllers/LicenceHandler.main
  122.     events:
  123.       - http:
  124.           path: licence
  125.           method: any
  126.           cors: true
  127.           authorizer: verify-token
  128.   user:
  129.     handler: controllers/UserHandler.main
  130.     events:
  131.       - http:
  132.           path: user
  133.           method: any
  134.           cors: true
  135.           authorizer: verify-token
  136.       - http:
  137.           path: user/{id}
  138.           method: any
  139.           cors: true
  140.           authorizer: verify-token
  141.   resetUserPassword:
  142.     handler: controllers/UserHandler.resetUserPassword
  143.     events:
  144.       - http:
  145.           path: user/resetUserPassword/{id}
  146.           method: get
  147.           cors: true
  148.           authorizer: verify-token
  149.   me:
  150.     handler: controllers/UserHandler.me
  151.     events:
  152.       - http:
  153.           path: user/me
  154.           method: any
  155.           cors: true
  156.           authorizer: verify-token
  157.   # resetMyPassword:
  158.   #   handler: controllers/UserHandler.resetMyPassword
  159.   #   events:
  160.   #     - http:
  161.   #         path: user/me/resetMyPassword
  162.   #         method: post
  163.   #         cors: true
  164.   #         authorizer: verify-token
  165.   # uploadAvatar:
  166.   #   handler: controllers/UserHandler.uploadAvatar
  167.   #   events:
  168.   #     - http:
  169.   #         path: user/me/uploadAvatar
  170.   #         method: post
  171.   #         cors: true
  172.   #         authorizer: verify-token
  173.   project:
  174.     handler: controllers/ProjectsHandler.main
  175.     events:
  176.       - http:
  177.           path: project
  178.           method: any
  179.           cors: true
  180.           authorizer: verify-token
  181.       - http:
  182.           path: project/{project_id}
  183.           method: any
  184.           cors: true
  185.           authorizer: verify-token
  186.      
  187.   extraction_job_project:
  188.     handler: controllers/ExtractionJobHandler.getByProjectId
  189.     events:
  190.       - http:
  191.           path: project/{project_id}/extraction
  192.           method: get
  193.           cors: true
  194.           authorizer: verify-token
  195.  
  196.   extraction_job:
  197.     handler: controllers/ExtractionJobHandler.main
  198.     events:
  199.       - http:
  200.           path: extraction
  201.           method: any
  202.           cors: true
  203.           authorizer: verify-token
  204.       - http:
  205.           path: extraction/{id}
  206.           method: any
  207.           cors: true
  208.           authorizer: verify-token
  209.  
  210.   batch:
  211.     handler: controllers/BatchesHandler.main
  212.     events:
  213.       - http:
  214.           path: batches/{project_id}/batch
  215.           method: any
  216.           cors: true
  217.           authorizer: verify-token
  218.       - http:
  219.           path: batches/{project_id}/batch/{id}
  220.           method: any
  221.           cors: true
  222.           authorizer: verify-token
  223.   folder:
  224.     handler: controllers/FoldersHandler.main
  225.     events:
  226.       - http:
  227.           path: folder
  228.           method: any
  229.           cors: true
  230.           authorizer: verify-token
  231.       - http:
  232.           path: folder/{folder_id}
  233.           method: any
  234.           cors: true
  235.           authorizer: verify-token
  236.   file:
  237.     handler: controllers/FilesHandler.main
  238.     events:
  239.       - http:
  240.           path: files/{folder_id}/file
  241.           method: any
  242.           cors: true
  243.           authorizer: verify-token
  244.       - http:
  245.           path: files/{folder_id}/file/{id}
  246.           method: any
  247.           cors: true
  248.           authorizer: verify-token
  249.   filePresignedUrl:
  250.     handler: controllers/FilesHandler.getPresignedUrl
  251.     events:
  252.       - http:
  253.           path: files/{folder_id}/getPresignedUrl
  254.           method: post
  255.           cors: true
  256.           authorizer: verify-token
  257.   role:
  258.     handler: controllers/RolesHandler.main
  259.     events:
  260.       - http:
  261.           path: roles
  262.           method: any
  263.           cors: true
  264.           authorizer: verify-token
  265.       - http:
  266.           path: roles/{id}
  267.           method: any
  268.           cors: true
  269.           authorizer: verify-token
  270.   config:
  271.     handler: controllers/ConfigHandler.main
  272.     events:
  273.       - http:
  274.           path: config
  275.           method: any
  276.           cors: true
  277.           authorizer: verify-token        
  278.   subdomain:
  279.     handler: controllers/SubdomainHandler.main
  280.     events:
  281.       - http:
  282.           path: subdomain
  283.           method: get
  284.           cors: true
  285. plugins:
  286.   - serverless-offline
  287. #  - serverless-apigw-binary
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top