Randys archive notes - mdemr-test/archive GitHub Wiki

Loading Notes

Create AWS Security ID for S3 REST and HTTP Requests

  • Login to the AWS Dashboard and navigate to IAM.
  • Under IAM select users and your specific user by clicking on the entry.
  • Select the Security Credentials tab.
  • Under the Access Keys section click "Create access key".
  • Record the ID and Secret for this key. This is the only time the secret is displayed.

Uploading Files to Host Archives S3 Buckets

  • AWS Reference URLs:

    https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html#examples

  • Open desktop console (PowerShell, Linux Terminal, etc)

  • Start the AWS CLI with the command aws configure.

  • At the prompt enter the following values. The User ID and Secret are the IAM security credentials for the user under Access Keys.

    1. User ID
    2. Secret
    3. Region: This is the region value in AWS. e.g.: us-west-2
    4. Default Output Format: leave blank and hit enter.
  • Login to the AWS Dashboard and navigate to S3 in a web browser. Note, Chrome based browsers may have issues. If so, use Firefox.

  • The hosted archive entry is mdemr-archive-us-west-2.

  • Select the bucket number corresponding to the project and create any necessary directories that don't exist (e.g.: intdoc_pdf, ext, appointment_summaries, etc).

  • In the desktop console, navigate to the root directory of the files to be uploaded, and use the following command to upload the files. aws s3 cp . s3://mdemr-archive-us-west-2/<bucket_number>/ext/ --recursive where <bucket_number> is the number of the corresponding project and "ext" would be the directory for attachments.

  • From the S3 interface in a web browser you can click on and enter the target upload folder and check if files are successfully uploading.

Tokens, Auth, and Keycloak

  • Install the Insomnia REST client from https://insomnia.rest/.
  • Download and import this JSON from ShareFile into Insomnia: MDEMR Internal > Tools > Archive > hosted-fhir-queries-insomnia.json.
    • Treat this with care and delete the json file after importing it into Insomnia. It contains the keys and auth to the MDEMR archive.
    • Delete the create-repo and create-project entries unless you need to create those. Don't run them unless you need to do those tasks!
  • Login to Keycloak URL at https://auth.mdemrarchive.com/. Navigate to the Realm entries and select the realm guid for the project. Since you can't see the names just go through them until you find the project entry. Copy the project realm guid to the clipboard or file. It will be used for the next step. Don't close Keycloak, we'll be using it further.
  • Open Insomnia and navigate to the loading-token entry. In the URL replace the existing guid with the project guid. https://auth.mdemrarchive.com/auth/realms/PROJECT-GUID-GOES-HERE/protocol/openid-connect/token