Skip to content

Turiddru/generic-jasper-reports-with-aws-lambda

 
 

Repository files navigation

generic-jasper-reports-with-aws-lambda

Generic JasperReports Service using AWS Lambda

This repo contains code for a Java JasperReport Lambda function. It is based on AWS sample code: Jasper Reports with Lambda, RDS and API Gateway

In this case we do not use an RDS connection. The parameters and data sources to include in the report are passed in the body of POST call.

The use of SDK1 has also been changed to SDK2 to increase speed and improve performance.

Content summary:

  • Java Maven code
  • AWS IaC Files: CloudFormation stack & API swagger
  • Test files: JasperReports test template & Postman collection
  • Basic scripts to automate process: build application, create AWS buckets, syncronize resources & launch CloudFormation stack

Requirements

All step scripts uses Docker. No additional software (java, maven or aws-cli) is required.

Usage steps

  1. Get AWS credentials.
  2. Modify aws_config/credentials file with correct values.
  3. Review aws_config/config file to ensure that region is correct.
  4. Review lambda_config.sh file to ensure correct values for all properties, specially region, files_s3_bucket and templates_s3_bucket. The two last properties must be unique in AWS. Otherwise these cannot be created. See Amazon S3 Bucket Naming Requirements.
  5. Review jasperreports_stack.yml file to ensure that AvailabilityZone is correct.
  6. Review lambda_code/src/main/java/potaymaster/aws/lambda/jasperreports/AmazonS3Consumer.java file to ensure that region is correct.
  7. Set execute permissions to all .sh files.
  8. Execute 00.launch_all_steps.sh or execute the steps you want.
  9. When all scripts ends, go to AWS Web Console to check CloudFormation creation stack status.
  10. Wait until stack creation is complete and go to API Gateway to copy URL.
  11. Paste API URL into Postman call & launch test example.
  12. Enjoy !!

snapshot

About

Generic JasperReports Service using AWS Lambda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 88.8%
  • Shell 11.2%