codingtom
10/10/2023, 6:52 PMyarn medplum aws update-app dev (note that we use Yarn with a specific version of the CLI etc) for the latest 2.1.4, I get the following error:
Error: Stack with id MedplumDev-us-east-1 does not exist
It looks like there is a specialized -us-east-1 stack created if the primary stack is NOT in this region. However, ours is, so I'm not sure why it is looking for a stack with this name. Our medplum.dev.config.json in the same directory is as follows:
{
"apiPort": 8103,
"region": "us-east-1",
"name": "dev",
"accountNumber": "...",
"stackName": "MedplumDev",
"domainName": "medplum...",
"apiDomainName": "api...",
"baseUrl": "https://api...",
"appDomainName": "app...",
"storageDomainName": "storage...",
"storageBucketName": "...",
"maxAzs": 2,
"rdsInstances": 1,
"desiredServerCount": 1,
"serverMemory": 512,
"serverCpu": 256,
"serverImage": "medplum/medplum-server:latest",
"signingKeyId": "...",
"storagePublicKey": "...",
"apiSslCertArn": "...",
"appSslCertArn": "...",
"storageSslCertArn": "..."
}
I skimmed the Medplum codebase but could not see why this would be happening - code blocks seem to correctly gate on the configured region... I did notice this PR, which does something related to region - we are updating from a version older than this: https://github.com/medplum/medplum/pull/2879codingtom
10/10/2023, 7:06 PMAWS_REGION in my shell (I recall this being necessary for installation maybe?) but it didn't make a differencealexisrodgtz
10/11/2023, 9:54 PM"dependencies": {
"@medplum/cdk": "^2.1.4",
"@medplum/cli": "^2.1.4",
"aws-cdk-lib": "^2.88.0",
"cdk": "^2.88.0",
"constructs": "^10.2.69"
}alexisrodgtz
10/11/2023, 10:19 PMbuildStackDetails() is looking for stackName + '-us-east-1'. But stack is not being created with region sufix attached to it. 🤔
await buildStackDetails(new CloudFormationClient({ region: 'us-east-1' }), stackName + '-us-east-1', result);
https://github.com/medplum/medplum/blob/main/packages/cli/src/aws/utils.ts#L72C11-L72C28
I think it is failing in this line const describeStacksCommand = new DescribeStacksCommand({ StackName: stackName }); https://github.com/medplum/medplum/blob/main/packages/cli/src/aws/utils.ts#L88C37-L88C58
My ideas of what I understand is happening.
* My region is set to us-east-1. So, the code is only creating MedplumPrimaryStack , but not MedplumGlobalStack.
* cli aws should have the same logic to detect when region is not set to us-east-1. So deploy-app/update-app points to us-east-1 ? (Cheeeeecking, bc cli has the same logic 🤔 https://github.com/medplum/medplum/blob/main/packages/cli/src/aws/utils.ts#L71 )
https://github.com/medplum/medplum/blob/8baa1326ab6197be561b82ae5db9aee1fe1c34f6/packages/cdk/src/stack.ts#L15
In the mean time. I was able to run deploy-app using medplum/cli 2.0.31 versioncody
10/11/2023, 11:46 PMcody
10/11/2023, 11:47 PMcody
10/11/2023, 11:51 PMAWS_REGION=us-east-1 medplum aws update-app?
The logic for looking for the extra stack is here:
https://github.com/medplum/medplum/blob/main/packages/cli/src/aws/utils.ts#L71
if (cloudFormationClient.config.region !== 'us-east-1') {
I can research why that condition would be false even if setting AWS_REGION=us-east-1 :/codingtom
10/11/2023, 11:53 PMexport followed by the medplum command, but yes it seemed to have the same behavior