Closed vladbucur2000 closed 3 years ago
Tried running from the main repo:
$ infra % terraform apply
var.project_name
Enter a value: vlad
│Error: Missing required argument
│
│ The argument "region" is required, but was not set.
Tried running from the main repo:
$ infra % terraform apply
var.project_name
Enter a value: vlad
│Error: Missing required argument
│
│ The argument "region" is required, but was not set.
Apply from the root not ./infra/
That error is related to the absence of the aws provider in infra/ module. The provider is present in ./main.tf so apply can be run from . but not ./infra
Describe the bug
POST requests on api_url does not work when running multiple datalakes (healthcarelake-demo) (did not test with running a single one so i am not sure where is the problem)
To Reproduce
POST requests within POSTMAN
https://ka8fg5y9x1.execute-api.eu-west-2.amazonaws.com/demo : 403 Forbidden
https://ka8fg5y9x1.execute-api.eu-west-2.amazonaws.com/demo/Patient : 502 Bad Gateway
I used a Bearer token authentication and had the token tested in the API Gateway (aws console).
Expected behavior
Code: 201
Can you confirm your Authorization header doesn't include the prefix "Bearer " in the value
As for the 502, not sure the cause but it's possible that it may take a couple of minutes to become available after deploying.
Remove the prefix
I tested the API and encountered the following errors:
When using Oauth 2.0 in postman, with both "Bearer" prefix and none prefix it is giving "502 Bad Gateway"
The token used is tested in API Gateway, Cognito_Authorizer to be sure it is working
https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cognito-401-unauthorized/
Try id token and not access token
Considering our tests are working https://github.com/spe-uob/HealthcareLakeAPI/blob/main/tests/e2e_test.go
I'm going to close this issue for now in the understanding that this is a user error.
Feel free to reopen if you find it is not a user error
Only id token was working in the Cognito_authorizer.
However we tried with all of them.
I suggest you look at the screenshots from above to see if you see any mistakes in testing the requests to the API.
An alternative would be providing us an API (supposing that i am not deploying the infrastructure correctly) just for a small test.
I have tested it just now and it works. Full steps:
terraform apply
aws cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=thepasswordthatwasgenerated, --client-id theclientidthatwasgenerated
I have tested it just now and it works. Full steps:
terraform apply
aws cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=thepasswordthatwasgenerated, --client-id theclientidthatwasgenerated
- Header.Authorization => IdToken
- POST url/dev/Patient
That is what I've did.
I believe the issue could be using credentials that we gave you in the past. The deployment script generates a random password
I believe the issue could be using credentials that we gave you in the past. The deployment script generates a random password
Located in the terraform.tfstate
, right? There is no issue in obtaining the token.
And you have only set the header Authorization with no bearer prefix and no postman authorization flow
This was working fine
Yep "No Auth" was tested as well. Everything is on point. We tried both cookie cutter and single datalake deployments. None worked.
Are you testing one data lake or using the cookie cutter thing? We identified a naming conflict that would occur when applying multiple lakes to one account in https://github.com/spe-uob/HealthcareLakeAPI/blob/9e0461c4f4a3eec97cd55ec64b73a07d1d2ab026/modules/api_gateway/main.tf#L3
Multiple lakes are not officially supported by this module or the API module at this stage, anything you are working on there is experimental only. There is no official release
In conclusion HealthcareLakeDemo is not working?
There are too many repos and I find it very confusing. Which one is the one that we should deploy and test on it?
Hi, Demo is not an official project supported by our team. This repository is the parent module for our Terraform project. You can receive support for HealthcareLake or its dependencies (HealthcareLakeAPI and HealthcareLakeETL)
You can deploy this one. Please refer to the README to answer your questions about dependencies.
You need to have the api key as a header with the name "x-api-key" and the id_token needs to be put into the Authoriztion menu having selected "Bearer Token"
There is no need for api key. This has been made redundant. If you select No Auth and set Authorization header to IdToken it would work as shown in my screenshots. But Demo project is unsupported/experimental
Since this issue has been resolved, the thread will be locked to prevent further confusion. Please feel free to reach out if it is still unclear
Describe the bug POST requests on api_url does not work when running multiple datalakes (healthcarelake-demo) (did not test with running a single one so i am not sure where is the problem)
To Reproduce
POST requests within POSTMAN
https://ka8fg5y9x1.execute-api.eu-west-2.amazonaws.com/demo : 403 Forbidden
https://ka8fg5y9x1.execute-api.eu-west-2.amazonaws.com/demo/Patient : 502 Bad Gateway
I used a Bearer token authentication and had the token tested in the API Gateway (aws console).Expected behavior Code: 201