casualgardener
04/15/2024, 1:07 PMnpx cdk bootstrap -c config=medplum.dev.config.json
Error: Public key must be in PEM format (with the BEGIN/END PUBLIC KEY lines); got undefined
at new PublicKey (/Users/mac/Desktop/Claimant Meta/medplum-cdk-config/node_modules/@medplum/cdk/node_modules/aws-cdk-lib/aws-cloudfront/lib/public-key.js:1:1024)
at new L (/Users/mac/Desktop/Claimant Meta/medplum-cdk-config/node_modules/@medplum/cdk/dist/cjs/index.cjs:1:80062)
at new H (/Users/mac/Desktop/Claimant Meta/medplum-cdk-config/node_modules/@medplum/cdk/dist/cjs/index.cjs:1:83002)
at new B (/Users/mac/Desktop/Claimant Meta/medplum-cdk-config/node_modules/@medplum/cdk/dist/cjs/index.cjs:1:82648)
at /Users/mac/Desktop/Claimant Meta/medplum-cdk-config/node_modules/@medplum/cdk/dist/cjs/index.cjs:1:83629casualgardener
04/15/2024, 1:07 PMcasualgardener
04/15/2024, 1:08 PMrebeccalovering
04/15/2024, 2:44 PM-----BEGIN PUBLIC KEY-----?rebeccalovering
04/15/2024, 3:09 PMcasualgardener
04/15/2024, 3:44 PMcasualgardener
04/15/2024, 4:29 PMcasualgardener
04/15/2024, 4:31 PMrahul1
04/15/2024, 6:07 PMrahul1
04/15/2024, 6:08 PMslawa_p
04/17/2024, 12:56 PMnpx medplum aws init, and afterwards checked that a new public key was created which started with -----BEGIN PUBLIC KEY-----.
After running the next step npx cdk bootstrap -c config=... I received the error Public key must be in PEM format (with the BEGIN/END PUBLIC KEY lines); got undefined, same as in this topic.
I tried following the suggested solution and deleting the key, but am still receiving the same error.
I have also restored the key with the key-content I copied and saved previously, but the error does not change.
@casualgardener What did you do after deleting your public key from CloudFront?casualgardener
04/17/2024, 2:59 PMcasualgardener
04/17/2024, 2:59 PMcasualgardener
04/17/2024, 8:14 PMcasualgardener
04/17/2024, 8:15 PMcasualgardener
04/17/2024, 8:15 PMslawa_p
04/18/2024, 8:52 AMPublic key must be in PEM format (with the BEGIN/END PUBLIC KEY lines); got undefined had nothing to do with the public key in CloudFront (at least in my case).
Instead something went wrong during the execution of npx medplum aws init and the following 3 parameters were missing in Systems Manager -> Parameter Store:
/medplum/<environment_name>/signingKey
/medplum/<environment_name>/signingKeyId
/medplum/<environment_name>/signingKeyPassphrase
I managed to solve this issue by deleting the public key, parameters and medplum..config.json and then rerunning npx medplum aws init.
I had to execute this process twice before all necessary parameters were generated (the parameter list can be seen in the video guide: ).