service: esdp-api app: esdp-api-app frameworkVersion: '4' stages: prod: # Enables observability in the prod stage observability: true # Sepcify parameter values to be used in the prod stage params: es_endpoint: https://insurtechtoolkit.com domain: es.imex.online es_user: Imex2 es_password: Patrick beta: # Enables observability in the prod stage observability: false # Sepcify parameter values to be used in the prod stage params: es_endpoint: https://4284-79073.el-alt.com domain: beta.es.imex.online es_user: Imex2 es_password: Patrick alpha: # Enables observability in the prod stage observability: false # Sepcify parameter values to be used in the prod stage params: es_endpoint: https://4284-79287.el-alt.com domain: alpha.es.imex.online es_user: Imex2 es_password: Patrick dev: # Enables observability in the prod stage observability: false # Sepcify parameter values to be used in the prod stage params: es_endpoint: https://4284-79287.el-alt.com domain: dev.es.imex.online es_user: Imex2 es_password: Patrick # params: # dev: # domain: dev.es.imex.online # alpha: # domain: alpha.es.imex.online # beta: # domain: beta.es.imex.online # prod: # domain: es.imex.online provider: name: aws runtime: nodejs22.x region: ca-central-1 domain: ${param:domain} httpApi: # This creates a cheaper, faster "HTTP API" Gateway cors: true # Automatically configures CORS build: esbuild: bundle: true minify: false sourcemap: true exclude: - '@aws-sdk/*' target: node22 platform: node functions: vehicleType: handler: src/handlers/vehicleType.handler events: - httpApi: path: /vehicleType method: post scrub: handler: src/handlers/scrub.handler environment: ES_ENDPOINT: ${param:es_endpoint} ES_USER: ${param:es_user} ES_PASSWORD: ${param:es_password} events: - httpApi: path: /scrub method: post emsupload: handler: src/handlers/emsupload.handler environment: ES_ENDPOINT: ${param:es_endpoint} UPLOAD_BUCKET_NAME: ${self:service}-uploads-${sls:stage} iamRoleStatements: - Effect: Allow Action: - s3:PutObject - s3:PutObjectAcl - s3:GetObject Resource: - arn:aws:s3:::${self:service}-uploads-${sls:stage}/* events: - httpApi: path: /emsupload method: post resources: Resources: UploadBucket: Type: AWS::S3::Bucket Properties: BucketName: ${self:service}-uploads-${sls:stage} CorsConfiguration: CorsRules: - AllowedOrigins: - '*' AllowedMethods: - PUT - POST AllowedHeaders: - '*'