All Projects → asc-lab → aws-lambda-billing

asc-lab / aws-lambda-billing

Licence: Apache-2.0 license
AWS Lambda with Micronaut and without any framework - billing in serverless architecture.

Programming Languages

kotlin
9241 projects
HCL
1544 projects
shell
77523 projects

Projects that are alternatives of or similar to aws-lambda-billing

portfoliomanager
Finance portfolio management for Indians. Track financial goals using contributions to Provident Fund, Sukanya Samriddhi, Mutual Funds, Shares, Restricted Stock Units, Employee Stock Purchase Plan, 401K, Gold, Crypto
Stars: ✭ 27 (-12.9%)
Mutual labels:  insurance
sample-micronaut-microservices
sample micronaut application illustrates using basic microservices patterns like distributed configuration and service discovery with Consul, distributed tracing with Zipkin, inter-service communication with micronaut http client
Stars: ✭ 38 (+22.58%)
Mutual labels:  micronaut
heterogeneous-microservices
Implementation of the same simple microservice on different frameworks
Stars: ✭ 43 (+38.71%)
Mutual labels:  micronaut
micronaut-camunda-bpm
Integration between Micronaut and Camunda (Workflow Engine). We configure Camunda with sensible defaults, so that you can get started with minimum configuration: simply add a dependency in your Micronaut project to embed the workflow engine!
Stars: ✭ 73 (+135.48%)
Mutual labels:  micronaut
XGBoost-in-Insurance-2017
Data and Code to reproduce results for my talk at Paris: R in Insurance 2017 Conference
Stars: ✭ 16 (-48.39%)
Mutual labels:  insurance
micronaut-camunda-external-client
This open source project allows you to easily integrate Camunda's External Task Clients into Micronaut projects: simply add a dependency in your Micronaut project
Stars: ✭ 19 (-38.71%)
Mutual labels:  micronaut
HealthCare-Insurance-Ethereum
Medical insurance claiming DApp which uses a Multi-Sig type approach to grant claim (ConsenSys project)
Stars: ✭ 65 (+109.68%)
Mutual labels:  insurance
ontology
Global Insurance Ontology
Stars: ✭ 71 (+129.03%)
Mutual labels:  insurance
OasisLMF
Loss modelling framework.
Stars: ✭ 84 (+170.97%)
Mutual labels:  insurance
insurancerating
R-package for actuarial pricing
Stars: ✭ 40 (+29.03%)
Mutual labels:  insurance
cloudco-insurance
A modern insurance company. The application showcases cognitive and cloud computing ideas in the context of insurance.
Stars: ✭ 43 (+38.71%)
Mutual labels:  insurance
quant-jobs-zurich
A list of companies of possible interest for mathematicians (or related) that are looking for a job in quantitative finance in Zurich.
Stars: ✭ 59 (+90.32%)
Mutual labels:  insurance
poc-micronaut-kotlin-grpc
Prova de conceito - Micronaut, Kotlin e GRPC
Stars: ✭ 14 (-54.84%)
Mutual labels:  micronaut
micronaut-openapi-codegen
OpenAPI codegen for Micronaut
Stars: ✭ 26 (-16.13%)
Mutual labels:  micronaut
dictum
🤔 API to get access to the collection of the most inspiring expressions of mankind
Stars: ✭ 77 (+148.39%)
Mutual labels:  micronaut
native-java-examples
Native Java Apps with Micronaut, Quarkus, and Spring Boot
Stars: ✭ 44 (+41.94%)
Mutual labels:  micronaut
testing-microservices-introduction
Learn some of the high level microservices testing cases with hands on examples.
Stars: ✭ 27 (-12.9%)
Mutual labels:  micronaut
nxrocks
Set of Nx plugins to enhance your Nx workspace (even more!)
Stars: ✭ 165 (+432.26%)
Mutual labels:  micronaut
wonky
Slack made easy for orgs
Stars: ✭ 27 (-12.9%)
Mutual labels:  micronaut
opta-invest
Spring Boot/Quarkus/Micronaut + Optaplanner Portfolio Optimization
Stars: ✭ 21 (-32.26%)
Mutual labels:  micronaut

AWS Lambda Billing PoC

This example shows simplified billing system in serverless architecture.

Comprehensive guide describing exactly the architecture, applied design patterns and technologies can be found on our blog in article Simplified billing system with AWS Lambda. Comparision: Kotlin + Micronaut vs Kotlin + Dagger vs vanilla Kotlin.

We encourage you to read, because in this README there is only a substitute for all information.

Architecture

  1. User uploads CSV file (with name structure CLIENTCODE_YEAR_MONTH_activeList.txt) with Beneficiaries (the sample file is located in the data-examples folder) to a specific data storage - asc-lab-serverless-input S3 Bucket.

  2. The above action triggers a function (GenerateBillingItemsFunc) that is responsible for:

    • generating billing items (using prices from an external database - PriceList table in DynamoDB) and saving them in the table BillingItem;
    • sending message about the need to create a new invoice to invoice-generation-request-queue;
  3. When a new message appears on the invoice-generation-request-queue, next function is triggered (GenerateInvoiceFunc). This function creates domain object Invoice and save this object in database (DynamoDB Invoices table) and send message to queues: invoice-print-request-queue and invoice-notification-request-queue.

  4. When a new message appears on the invoice-print-request-queue, function PrintInvoiceFunc is triggered. This function uses external engine to PDF generation - JsReport and saves PDF file in asc-lab-serverless-printout S3 Bucket.

  5. When a new message appears on the invoice-notification-request-queue, function NotifyInvoiceFunc is triggered. This function uses two external systems - SendGrid to email sending and Twilio to SMS sending.

Preparation

Deployment requires AWS CLI and Terraform

Before first deployment you need to initialize Terraform with

init.sh

Also you need to create some external accounts and informations

  1. jsreportonline (https://jsreportonline.net/) - just username and password
  2. SendGrid (https://sendgrid.com/) - API key
  3. Twilio (https://www.twilio.com/) - Account SID and Auth Token

As a last step, you need to create variables file to give all the above information to Terraform. Create file billing.tfvars in main folder insides should looks like this:

jsreport_url = "https://some_user.jsreportonline.net/api/report"
jsreport_username = "some_user"
jsreport_password = "some_password"
sendgrid_api_key = "SG.rePNAA_AAAAaAA1aAAAi6w.r5AAAUZhyaaaUo7w0030MFAauAaTWvXw-n11mpAaqe0"
twilio_account_sid = "ACd111feb1c11f11111111cd1dd1111c11"
twilio_auth_token = "1ed1a11111b1af1111b111d1111dd11d"

Building and Deployment

Terraform should create all necessary infrastructure (S3 bucket, SQS Queues, DynamoDB Tables (with data)) and deploy lambdas code.

buildAndDeploy.sh

Testing

You should see S3 Bucket called asc-lab-serverless-input. Put there sample file and enjoy logs in AWS CloudWatch.

Disabling

SQS triggers can actively check queues for new messages. If you don't want to exceed your free tier, you can disable them using our Terraform configuration. Just run:

terraform apply -auto-approve -var-file="billing.tfvars" -var "active=false" terraform

To re-enable triggers run:

terraform apply -auto-approve -var-file="billing.tfvars" -var "active=true" terraform
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].