{"id":20340218,"url":"https://github.com/stefano-m/aws-hello-world","last_synced_at":"2026-06-05T08:31:30.248Z","repository":{"id":96809116,"uuid":"311973784","full_name":"stefano-m/aws-hello-world","owner":"stefano-m","description":"A simple Hello World on AWS","archived":false,"fork":false,"pushed_at":"2020-11-11T13:29:07.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-14T18:10:28.417Z","etag":null,"topics":["aws","example","iac"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefano-m.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-11T13:08:31.000Z","updated_at":"2020-11-11T13:29:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c852f21c-95d9-41b4-86a3-aefb2c891ac3","html_url":"https://github.com/stefano-m/aws-hello-world","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/stefano-m%2Faws-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefano-m%2Faws-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefano-m%2Faws-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefano-m%2Faws-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefano-m","download_url":"https://codeload.github.com/stefano-m/aws-hello-world/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241867649,"owners_count":20033815,"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","example","iac"],"created_at":"2024-11-14T21:20:16.682Z","updated_at":"2025-03-04T14:45:00.333Z","avatar_url":"https://github.com/stefano-m.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An AWS Hello World Service\n\nHello World is a Web Service that greets everyone.\n\nThe service exposes a single endpoint `/hello` that accepts `GET` requests and\nreturns a `text/plain` response consisting of the phrase `hello, world!` and\nthe current date and time.\n\nFor example:\n\n``` http\nGET /hello\n\nhello, world! 10/Nov/2020:20:52:11 +0000\n```\n\nThe service is comprised of an AWS REST API Gateway with a single entry\npoint. Nothing else is needed. The entry point uses a [mock\nintegration](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock-integration.html)\nconfigured with a mapping template so that the appropriate response is\nreturned.\n\nPreliminary tests have shown that with a load of 7,000 requests/second the 95th\npercentile of the network latency is around 2.1 ms. This has been done with\nboth client and service within the same geographical region.\n\nThe approach taken has the following advantages:\n\n- cost-effective\n- reduced maintenance burden\n- easy to extend and modify\n- HTTPS by default\n- low-latency\n\nThe price we pay is that we are tied to AWS and will need to design a different\nsolution if we wanted to move to another cloud provider. However, given the\nsimplicity of the service, I think it's worth it.\n\n-----\n\n**NOTE**\n\nThis configuration does **not** set up a custom domain name, but uses the\ndefault invocation URL that looks like\n`https://\u003cID\u003e.execute-api.\u003cREGION\u003e.amazonaws.com`. However, setting up a custom\ndomain name would not be too hard.\n\n-----\n\n## Logging, Monitoring and Alerting\n\nThe service logs to, and can be monitored with, CloudWatch. Again, although\nthis choice is tied to using AWS, the advantage is that there is no\ninfrastructure to manage.\n\nLogging is configured with Terraform. Access logs are JSON-formatted to make\nanalysis with CloudWatch Logs Insights easier.\n\nCloudWatch alerts have not been set up yet. They should be set up after\nobserving the system under load in the staging environment to have an idea of\nthe how it behaves.\n\nIt's advisable to alert on the following metrics:\n\n1. Latency and IntegrationLatency: to catch issues with performance\n2. 5XXError: to catch possible bugs with the service\n3. 4XXError: to detect potential malicious activity\n\n## Building\n\nPre-requisites:\n\n- OS: GNU/Linux\n- GNU coreutils (`grep`, `rm`, `sha256sum`, etc.)\n- GNU Make 4.x\n- curl\n- zip\n\nThe provided [`Makefile`](./Makefile) is used to drive the deployment and\ntests. If needed, it will download the supported version of Terraform to use.\n\nFor more information, run `make help` and refer to the [`Makefile`](./Makefile)\nsource.\n\nThe Terraform configuration is documented in\n[`docs/README.md`](./docs/README.md). The documentation has been generated\nusing the `terraform-docs` utility.\n\nThe invocation URL can be obtained from the `api_url` terraform output, e.g. by\ncalling `make output`.\n\n### Deploying\n\nThe service can be deployed with `make apply`, use the GNU Make variable\n`tf-workspace` to select the deployment environment: development, staging,\nproduction. The workspace name is also validated by Terraform itself (using a\nspecial `null_resource`) to minimize the chance of mistakes.\n\n-----\n\n**NOTE**\n\nThe Terraform state is currently configured to use the **local** backend. That\nis, the state file is saved on the local disk. For proper production-readiness,\nan **S3** backend with encryption at rest and state locking should be used\ninstead.\n\n-----\n\n### Testing\n\nThis service is very simple, but that does not mean we should not test it!\n\nAfter deploying, run `make test` to check that the service replies as expected.\n\nYou can test the system under load with `make load-test`.\n\nThe code is in the [`tests`](./tests) directory.\n\nTest automation could be run like\n\n``` shell\nmake tf-workspace=development validate apply test\n```\n\n## Further Improvements\n\nFurther improvements to the service and code base could be:\n\n- set up an encrypted S3 backend with state locking for the Terraform state\n- add tests to ensure that logs are delivered to CloudWatch\n- set up CloudWatch Alarms and deliver notifications using the correct channels\n  (e.g. live chat apps, email, etc.)\n- set up CloudTrail to monitor activity at the AWS level\n- set up a CI/CD pipeline\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefano-m%2Faws-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefano-m%2Faws-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefano-m%2Faws-hello-world/lists"}