{"id":21433098,"url":"https://github.com/randomtask2000/aws-lambda-sqs-terraform-java","last_synced_at":"2026-01-04T04:06:47.097Z","repository":{"id":218614822,"uuid":"395802813","full_name":"randomtask2000/aws-lambda-sqs-terraform-java","owner":"randomtask2000","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-14T05:09:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T08:44:18.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/randomtask2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-13T21:33:35.000Z","updated_at":"2021-08-14T05:10:01.000Z","dependencies_parsed_at":"2024-01-23T01:49:56.563Z","dependency_job_id":null,"html_url":"https://github.com/randomtask2000/aws-lambda-sqs-terraform-java","commit_stats":null,"previous_names":["randomtask2000/aws-lambda-sqs-terraform-java"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Faws-lambda-sqs-terraform-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Faws-lambda-sqs-terraform-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Faws-lambda-sqs-terraform-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Faws-lambda-sqs-terraform-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randomtask2000","download_url":"https://codeload.github.com/randomtask2000/aws-lambda-sqs-terraform-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945527,"owners_count":20372893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T23:24:58.999Z","updated_at":"2026-01-04T04:06:47.025Z","avatar_url":"https://github.com/randomtask2000.png","language":"HCL","readme":"# aws-lambda-terraform\n\nThis repo demonstrates how to create Lambda's in both `Java` with the help of `Terraform`. \n\n## Get started\n\nGo to the `java` directory and do the following:\n\nTo get started simply create a `terraform.tfvars` file in `terraform`\ndirectory with your AWS account/IAM User details. Your IAM User must have\n[permissions](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html)\nfor AWS Lambda and AWS API Gateway.\n\nThe contents should follow the template below (with you replacing the info\nbetween `\u003c\u003c \u003e\u003e`):\n\n```\naws_access_key = \"\u003c\u003c your IAM user AWS access key \u003e\u003e\"\naws_secret_key = \"\u003c\u003c your IAM user AWS secret key \u003e\u003e\"\nregion = \"\u003c\u003c your chosen region \u003e\u003e\"\naccount_id = \"\u003c\u003cyour AWS account id\u003e\u003e\"\n\n```\n\nOr instead of the above, you can apply the account key and secret to your terminal session. See .`/terraform/main.tf` for more details:\n\n```\nexport AWS_ACCESS_KEY_ID=\"\u003c\u003c your IAM user AWS access key \u003e\u003e\"\nexport AWS_SECRET_ACCESS_KEY=\"\u003c\u003c your IAM user AWS secret key \u003e\u003e\"\nexport AWS_SESSION_TOKEN=\"\u003c\u003c your session token when needed \u003e\u003e\"\n```\n\nFrom the root of the project run the `build_and_deploy.sh` script.\nThis compiles the Java application into the `helloworld/target` directory\nand runs Terraform to upload and configure the Lambda function and API Gateway.\n\n```\n$ ./build_and_deploy.sh\n```\n\n## Manually test your function\n\nAfter a successful run, something similar to the output below should be visible:\n\n```\nOutputs:\n\ncurl = Run the following to test the lambda:\ncurl -H 'Content-Type: application/json' -X POST -d '{\"name\": \"Emilio\"}' https://XXXXXXXXXX.execute-api.us-east-1.amazonaws.com/beta/helloworld\n```\n\nTo test your Lambda deployed behind the API Gateway all you need to do is\ncopy/paste the curl command (minus the `curl = ` part) e.g.\n\n```\ncurl -H 'Content-Type: application/json' -X POST -d '{\"name\": \"Emilio\"}' https://XXXXXXXXXX.execute-api.us-east-1.amazonaws.com/beta/helloworld\n```\n\n## Rinse and repeat\n\nYou can make changes to the Java application and run the `build_and_deploy.sh`\nscript repeatedly to update the Lambda Function deployed into AWS.\n\n## Tidy up when finished!\n\nWhen you are finished, don't forget to shut your infrastructure down:\n\n```\n$ ./destroy.sh\n```\n\n## Disclaimer\n\nPlease note: I'm not responsible for any costs incurred within your AWS account :-)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomtask2000%2Faws-lambda-sqs-terraform-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandomtask2000%2Faws-lambda-sqs-terraform-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomtask2000%2Faws-lambda-sqs-terraform-java/lists"}