service: IM-CAPITAL-BACKEND-SERVICE

frameworkVersion: "3"

# Create an optimized package for our functions
package:
  individually: true

configValidationMode: off

plugins:
  - serverless-offline

provider:
  name: aws
  runtime: nodejs18.x
  region: eu-west-1
  stage: DEV
  deploymentBucket:
    name: imcapital-dev-lambda-deployment
    serverSideEncryption: AES256  
  iam:
    role: arn:aws:iam::597707462019:role/IMCapital_serverless_deployment # must validly reference a role defined in your account
  vpc:
    securityGroupIds:
      - sg-0089502251d79aa23
    subnetIds:
      - subnet-08882af1374cdd5d2
      - subnet-0b9b9e77b66be7a4d
  iamRoleStatements:
    - Effect: Allow
      Action:
        - ec2:DescribeNetworkInterfaces
        - ec2:CreateNetworkInterface
        - ec2:DeleteNetworkInterface
        - ec2:DescribeInstances
        - ec2:AttachNetworkInterface
      Resource: "*"

functions:
  getToken:
    handler: handler.getToken
    events:
      - http:
          path: /getToken
          method: get
  getMembers:
    handler: sanlam_subgroup_members.getToken
    events:
      - http:
          path: /getMembers
          method: get        
  getStatements:
    handler: sanlam_statement_data.getToken
    events:
      - http:
          path: /getStatements
          method: get 
  getTokenCheck:
    handler: token_check.getTokenCheck
    events:
      - http:
          path: /getTokenCheck
          method: get          
