@medplum/cdk 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # Medplum Infra
2
+
3
+ CDK scripts to setup the full stack:
4
+
5
+ - S3 + CloudFront for static site
6
+ - VPC for private network
7
+ - Fargate for backend server
8
+ - Aurora RDS for database
9
+
10
+ ### Install
11
+
12
+ Medplum uses [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) for a monorepo configuration.
13
+
14
+ See [Developer Setup](https://www.medplum.com/docs/contributing) for cloning the repository and installing dependencies.
15
+
16
+ ### Deploy
17
+
18
+ First, create a configuration file.
19
+
20
+ Next, it is strongly recommended to `diff` changes before deploying.
21
+
22
+ ```bash
23
+ npx cdk diff -c config=my-config.json
24
+ ```
25
+
26
+ ```bash
27
+ npx cdk deploy -c config=my-config.json
28
+ ```
29
+
30
+ ### Destroy
31
+
32
+ ```
33
+ npx cdk destroy
34
+ ```
35
+
36
+ ### Front End
37
+
38
+ Based on: https://github.com/aws-samples/aws-cdk-examples/tree/master/typescript/static-site
39
+
40
+ Creates:
41
+
42
+ - S3 Bucket
43
+ - CloudFront distribution
44
+ - SSL Certificate
45
+ - Route 53 Entries
46
+
47
+ ### Back End
48
+
49
+ Based on: Based on: https://github.com/aws-samples/http-api-aws-fargate-cdk/blob/master/cdk/singleAccount/lib/fargate-vpclink-stack.ts
50
+
51
+ Creates:
52
+
53
+ - VPC
54
+ - Security Groups
55
+ - Fargate Task and Service
56
+ - CloudWatch Log Groups
57
+ - Load Balancer
58
+ - SSL Certificate
59
+ - Route 53 Entries
60
+
61
+ ### Storage
62
+
63
+ Based on:
64
+
65
+ The CloudFront distribution requires a public key for signature verification.
66
+
67
+ Generate a 2048 bit RSA key:
68
+
69
+ ```sh
70
+ openssl genrsa -des3 -out private.pem 2048
71
+ ```
72
+
73
+ Export the public key to a file:
74
+
75
+ ```sh
76
+ openssl rsa -in private.pem -outform PEM -pubout -out public.pem
77
+ ```
78
+
79
+ Open the `public.pem` file and ensure that it starts with `-----BEGIN PUBLIC KEY-----`. This is how you know that this file is the public key of the pair and not a private key.
80
+
81
+ Add the public key to the CDK infrastructure configuration.
82
+
83
+ Add the private key to the server configuration settings (JSON, AWS Parameter Store, etc).
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-typescript"]
3
+ }
package/cdk.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "app": "ts-node src/index.ts"
3
+ }