Skip to content

AWS Reference Implementation

caspears edited this page Apr 26, 2023 · 13 revisions

Overview

A version of this reference implementation is hosted at https://cpcds-server.lantanagroup.com

Endpoints

Using the base url https://cpcds-server.lantanagroup.com the following endpoints are available:

Endpoint Method Description
oauth/register/client GET Webpage to register a new client
oauth/authorization GET Webpage for user to login and obtain an access code as part of OAuth flow
oauth/token POST OAuth token endpoint to exchange an access code for an access token
debug/Log GET Server log
debug/Clients GET Webpage for viewing the Clients table
debug/Users GET Webpage for viewing the Users table
fhir/metadata GET Capability statement for the fhir server
.well-known/smart-configuration GET Smart Configuration JSON object

Setting Up AWS

  1. Create a new EC2 instance: t3.large running Ubuntu 18.04 with security group "Port 80"
  2. SSH into the instance with ssh -i {pem file} ubuntu@{ipv6}
  3. Install docker
$ sudo apt update -y
$ sudo snap install docker
  1. Pull the latest image: sudo docker pull {image name from dockerhub}
  2. Run the container: sudo docker run -d -p 80:8080 {image name}

Note: every time the AWS url changes you will need to update server_address in src/main/resources/hapi.properties

Updating AWS

  1. Build the latest image: ./build-docker-image.sh
  2. Push the latest image: docker push {your dockerhub username}/cpcds-server-ri
  3. SSH into the instance with ssh -i {pem file} ubuntu@{ipv6}
  4. Pull the latest image: sudo docker pull {your dockerhub username}/cpcds-server-ri
  5. Stop the current image: sudo docker stop {container name}
  6. Run the container: sudo docker run -d -p 80:8080 -e ADMIN_TOKEN=admin -e SERVER_ADDRESS=https://cpcds-server.lantanagroup.com/fhir/ {your dockerhub username}/cpcds-server-ri
Clone this wiki locally