{"id":18401432,"url":"https://github.com/dozyio/hello-go-lambda-api-gateway-terraform","last_synced_at":"2025-04-07T07:31:29.822Z","repository":{"id":118202415,"uuid":"281371694","full_name":"dozyio/hello-go-lambda-api-gateway-terraform","owner":"dozyio","description":"Terraform all the things - AWS Lambda, Cogntio, API-Gateway with CORS, SQS, SNS, DynamoDB, SPA configuration","archived":true,"fork":false,"pushed_at":"2023-03-07T03:30:49.000Z","size":7076,"stargazers_count":0,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T03:32:48.072Z","etag":null,"topics":["aws-api-gateway","aws-lambda","cognito","cors","dynamodb","go","iac","sns","sqs","terraform","terraform-aws","vue","vuejs"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dozyio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-21T10:52:29.000Z","updated_at":"2023-08-21T02:15:04.000Z","dependencies_parsed_at":"2023-11-05T06:45:17.346Z","dependency_job_id":null,"html_url":"https://github.com/dozyio/hello-go-lambda-api-gateway-terraform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozyio%2Fhello-go-lambda-api-gateway-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozyio%2Fhello-go-lambda-api-gateway-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozyio%2Fhello-go-lambda-api-gateway-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozyio%2Fhello-go-lambda-api-gateway-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dozyio","download_url":"https://codeload.github.com/dozyio/hello-go-lambda-api-gateway-terraform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247612036,"owners_count":20966649,"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":["aws-api-gateway","aws-lambda","cognito","cors","dynamodb","go","iac","sns","sqs","terraform","terraform-aws","vue","vuejs"],"created_at":"2024-11-06T02:38:49.505Z","updated_at":"2025-04-07T07:31:29.805Z","avatar_url":"https://github.com/dozyio.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello Microservice - using AWS, Terraform and Vue.js\n\nExample hello microservice using Go AWS Lambdas, API Gateway with CORS and AWS Cognito for authentication - deployed using Terraform.\n\nAlso includes a sample Vue.js SPA frontend using AWS amplify auth and amplify api to consume the REST hello service. SPA configured via Terraform output.\n\n![Terraform - AWS API Gateway, Cognito, Lambda, SQS, SNS, DynamoDB](docs/terraform-aws-lambda-apigateway-cognito-sqs-dynamodb-sns-ssm.png)\n\n\nHello Lambda - protected by API gateway, returns CORS header. Invoked with a POST with json { \"name\": \"dozy\" }\n\nSQS Consumer - invoked by SQS, updates DynamoDB on SPA login / SPA page refresh after login.\n\nDead Letter Queue (DLQ) Consumer - to test the dead letter queue, you'll need to manually subscribe to the DLQ topic from the AWS console after deployment. \nTo force the SQS consumer to invoke the DLQ, you can change the lambda environment variable ALWAYS_ERROR to TRUE.\n\nParameters for lambdas stored in SSM parameter store. Parameters cached once retrieved by lambdas for 300 seconds, can be configured via env variables.\n\nSPA using Vue.js and Amplify framework for auth and api - configured from terraform output.\n\n# Setup\n```sh\ncd terraform \u0026\u0026 terraform init\n```\n\n# AWS region - defaults to eu-west-2\n```sh\nvi terraform/variables.tf\n```\n\n# Build\n```sh\nmake lamdas\n```\n\n# Deploy\n```sh\nmake apply\n```\n\n# SPA - config, build, run\n```sh\nmake spaconfig\ncd spa \u0026\u0026 npm install\ncd spa \u0026\u0026 npm run serve\n```\n\n# Redeploy api gateway\nThe api gateway sometimes needs redeploying (i.e. when changing auth or CORS settings). In this case you'll need to taint the terraform state with the following and redeploy.\n\n```sh\nmake taint\nmake apply\nmake spaconfig\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdozyio%2Fhello-go-lambda-api-gateway-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdozyio%2Fhello-go-lambda-api-gateway-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdozyio%2Fhello-go-lambda-api-gateway-terraform/lists"}