{"id":20761394,"url":"https://github.com/philips-labs/gwdemo","last_synced_at":"2025-03-11T17:19:39.857Z","repository":{"id":103438746,"uuid":"293561117","full_name":"philips-labs/gwdemo","owner":"philips-labs","description":"Terraform based demo demonstrating setting up an API gateway with backing services","archived":false,"fork":false,"pushed_at":"2024-04-24T12:49:34.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T05:30:47.510Z","etag":null,"topics":["api-gateway","demo","hsdp","terraform"],"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/philips-labs.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-09-07T15:11:01.000Z","updated_at":"2024-04-24T12:49:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c99470d2-9329-480d-b2f0-4da026009293","html_url":"https://github.com/philips-labs/gwdemo","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/philips-labs%2Fgwdemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-labs%2Fgwdemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-labs%2Fgwdemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-labs%2Fgwdemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philips-labs","download_url":"https://codeload.github.com/philips-labs/gwdemo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243076603,"owners_count":20232438,"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":["api-gateway","demo","hsdp","terraform"],"created_at":"2024-11-17T10:19:24.831Z","updated_at":"2025-03-11T17:19:39.832Z","avatar_url":"https://github.com/philips-labs.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gwdemo\n\nThis repo demonstrates how it's possible to implement an application on HSDP using an API gateway. Several new features of HSDP are used to make this a fully functional demo. The most important new feature is container to container networking with internal DNS for service discovery. This allows for the deployment of completely private services in Cloud Foundry. Each environment also has a special internal DNS domain that private apps are deployed into: apps.internal. When applications are deployed to this domain they will be unreachable externally or internally. It's not possible to make these apps reachable from outside the environment. Policies can be defined and applied that allow for internal traffic between applications.\n\nWhen communicating via the overlay network internal traffic bypasses the gorouter which is typically responsible for load-balancing traffic across multiple application instances. Round Robin DNS is used for load balancing traffic internally between applications. This is effectively the same (albeit less sophisticated) function as the gorouter serves for external traffic.\n\nInternal services are also not restricted to HTTP only. Any TCP/UDP port can be defined as allowed in the networking policies.\n\n## Disclaimer\n\n\u003e [!Important]\n\u003e This repository is managed as Philips Inner-source / Open-source.\n\u003e This repository is NOT endorsed or supported by HSSA\u0026P or I\u0026S Cloud Operations.\n\u003e You are expected to self-support or raise tickets on the Github project and NOT raise tickets in HSP ServiceNow.\n\n# terraform-cloudfoudry-gwdemo\n\nThe bulk of the resources we need to provision are declared in a [Terraform module](https://www.terraform.io/docs/modules/index.html). Introducing Terraform modules unlocks one of the more powerful aspects of using Terraform: reusable components. \n\nYou may want to head over to the [terraform-cloudfoudry-gwdemo](https://github.com/philips-labs/terraform-cloudfoundry-gwdemo) repository first to dive into the details. Alternatively, you can follow the rest of this README and deploy the gwdemo environment first and afterwards examine the module contents.\n\n# requirements\n\nIn order to deploy this demo you need to be onboarded onto HSDP Cloud foundry services an have `OrgAdmin` privileges.\nFuture versions of this demo will be `SpaceDeveloper` friendly. See the [hsdp.io](https://hsdp.io) portal for details. \nThe following information is required:\n\n- `cf_api_url` -- Cloud foundry API URL of the region e.g. https://api.eu1.phsdp.com\n- `cf_username` -- Your Cloud foundry username\n- `cf_password` -- Your Cloud foundry password\n- `cf_org_name` -- Your Cloud foundry ORG name. Usually starts with `client-...`\n\nThere are severals ways to let Terraform know about these values. You can create `terraform.tfvars` that looks like this:\n\n```hcl\ncf_api_url  = \"https://api.cloud.pcftest.com\"\ncf_username = \"alastname\"\ncf_password = \"@PassW0rd\"\ncf_org_name = \"client-cf-org\"\n```\n\nOr you can pas them as environment variables:\n\n```bash\n$ export TF_VAR_cf_api_url=https://api.cloud.pcftest.com\n$ export TF_VAR_cf_username=alastname\n...\n```\n\n# init\nThis step initializes Terraform and downloads providers and modules\n\n```bash\n$ terraform init\nInitializing modules...\nDownloading github.com/philips-labs/terraform-cloudfoundry-gwdemo for api_gateway...\n- api_gateway in .terraform/modules/api_gateway/src\n\nInitializing the backend...\n\nInitializing provider plugins...\n- Finding latest version of hashicorp/random...\n- Finding latest version of hashicorp/local...\n...\n...\nTerraform has been successfully initialized!\n...\n```\n\n# plan\nThis step plans out what terraform will do\n\n```bash\n$ terraform plan\nRefreshing Terraform state in-memory prior to plan...\nThe refreshed state will be used to calculate this plan, but will not be\npersisted to local or remote state storage.\n\nmodule.api_gateway.data.archive_file.users_api: Refreshing state...\nmodule.api_gateway.data.archive_file.devices_api: Refreshing state...\n...\n...\nPlan: 13 to add, 0 to change, 0 to destroy.\n\nChanges to Outputs:\n  + cf_org   = \"hsdp-demo-org\"\n  + cf_space = (known after apply)\n  + gw_url   = (known after apply)\n...\n```\n\n# apply\nThe apply step will actually create resources and deploy your applications\n\n```bash\n$ terraform apply -auto-approve\n...\nApply complete! Resources: 13 added, 0 changed, 0 destroyed.\n\nOutputs:\n\ncf_org = client-cf-org\ncf_space = gwdemo-0305fc1e2e423ecd\ngw_url = https://api-gateway-0305fc1e2e423ecd.us-east.philips-healthsuite.com\n```\n\nThe `apply` step should take about a minute to complete.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-labs%2Fgwdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilips-labs%2Fgwdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-labs%2Fgwdemo/lists"}