codingtom
09/20/2023, 10:41 PM@medplum/cdk package exported a few more things - e.g. the BackEnd, FrontEnd, etc classes. Heck, even the top-level MedplumStack would be useful. Would folks be opposed to adding these as exports from the package? This would allow myself and other groups to programmatically use the CDK configuration. It'd be a few extra lines of code in index.ts to re-export from the relevant source files, but the downside is that it increases the package's "API surface", which may be undesirable, I'm not sure.
I've tried importing the TS files from the package directly, which sort of works, but I think our TS config is more strict than yours and it complains about type errors - even with skipLibCheck etc turned on.
Alternatively, I can recreate the whole stack in native Pulumi configuration, but I kind of like being able to keep our config in sync with current Medplum best practices over time.
https://www.pulumi.com/
https://github.com/pulumi/pulumi-cdk
https://github.com/medplum/medplum/blob/main/packages/cdk/src/index.ts#L10cody
09/20/2023, 10:58 PMcody
09/20/2023, 11:19 PMcodingtom
09/20/2023, 11:51 PMcodingtom
09/20/2023, 11:54 PMlet statement, e.g.:
let record = undefined;
if (!config.skipDns) {
// ...
// TS Error: Type 'ARecord' is not assignable to type 'undefined'.ts(2322)
record = new route53.ARecord(this, "LoadBalancerAliasRecord", {
// ...
});
}codingtom
09/20/2023, 11:54 PMcodingtom
09/20/2023, 11:55 PMeslint@typescript-eslint/consistent-type-imports which complains about import { MedplumInfraConfig } from "@medplum/core"; - but that's just a style preference reallycody
09/21/2023, 7:00 PM