Integrating Medplum with AWS VPC
# support
p
Hi there 👋 We're thinking of using Medplum as our FHIR Data-store backend, and I've been reading the CDK code a bit to better understand exactly what to expect when deploying to AWS. It looks like I may be able to use a
MedplumInfraConfig
to setup a
vpcId
so that this will deploy the Medplum resources in our current VPC. Is this correct? And as a follow up, we currently have an Aurora Postgres & Elasticache cluster deployed, and in a perfect world would love to 'merge' the Medplum Postgres & Redis into these clusters. Is this a reasonable idea? It seems like I would need to change the CDK code slightly to pass in more resourceIds via a config, but I'm definitely not an expert in this area. Any help / ideas would be appreciated! Thanks 😄
I may have answered my first question by re-reading your docs (great docs btw 😎 ) It sounds like I can do something like this: - Make a new npm package to wrap the medplum cdk code - Add the deps (
@medplum/cdk @medplum/cli aws-cdk-lib
) etc - Run the medplum
aws init
script - From there, I can edit the
*.config.json
file to get our current VPC ID in there.
r
Thanks for your kind words! So with regards to merge - these are the supported configs https://www.medplum.com/docs/self-hosting/config-settings so that would be the best way to customize. Merging Postgres sounds, unconventional - but tell me more!
p
Thanks for the reply! Looking at the CDK Settings now. As for the merge of Postgres / Redis, we're thinking we already have these resources deployed, so there is a lot of value in re-use there. Our apps integrate with them, we've solved the VPC security group problems, redis replication groups config, postgres writer/readers setup, etc. Lastly it would probably save us some $$$ to not run two Aurora and Elasticache clusters. Also its quite nice that Medplum creates a database called
medplum
in Postgres, so in theory our apps would connect to our named database inside Aurora, and Medplum's backend would connect to the
medplum
database in Aurora. I might be missing something but this feels like it might "just work" assuming we setup the host/port/user/pass to point to our existing Aurora cluster because of this config (https://github.com/medplum/medplum/blob/main/packages/server/medplum.config.json#L30), right? I think we'd have to manually create the Medplum database and roles, but that shouldn't be too hard 🤔
r
In theory - yes, though this configuration is not really battle tested.
p
Just wanted to close the loop here - we were able to get Medplum deployed into our infra, and are successful in making auth'd requests to the Medplum data store 🙂 Thanks again!
r
appreciate the update!
160 Views