thomabig
05/22/2025, 8:18 PMsudo systemctl daemon-reload
sudo systemctl restart medplum
It looks like this is working correctly, but I'm wondering what are the downside and what is the actual recommended solution to handle the emails with amazonses ?
Is there any risk of loosing the environnement variable that have been manually added if I upgrade medplum for example ?
Thank you.Ian Plunkett
05/23/2025, 4:30 PMbash
# Create environment file
sudo mkdir -p /etc/medplum
sudo touch /etc/medplum/medplum.env
sudo chmod 600 /etc/medplum/medplum.env
Add your credentials to `/etc/medplum/medplum.env`:
AWS_ACCESS_KEY_ID=AKI****
AWS_SECRET_ACCESS_KEY=fT8YB4****
AWS_REGION=eu-central-1
Then modify the systemd service to reference this file:
ini
[Service]
EnvironmentFile=/etc/medplum/medplum.env
### 2. Use IAM roles (preferred for EC2)
If your VM is an EC2 instance, the most secure approach is using IAM roles:
- Create an IAM role with SES permissions
- Attach the role to your EC2 instance
- Remove the AWS credentials from your configuration entirely
This eliminates credential management and is more secure.
The IAM role approach is generally recommended for production deployments as it's more secure and doesn't require credential rotation. Your current method works but should be moved to a separate configuration file to prevent loss during updates.thomabig
06/05/2025, 9:19 PM