- Install tar
- Install Node 18
- Install CDK
npm install -g aws-cdk
- Install aws cli
- Install python 3.9.13
- Make a new directory
- Clone cloudpro-cdk repo
- CD into directory
- create a venv
python -m venv .venv
- Activate virtual environment
source.bat
- Install requirements
pip install -r requirements.txt
- Set access to your AWS Cloud Account
SET AWS_ACCESS_KEY_ID={your_access_key_id}
SET AWS_SECRET_ACCESS_KEY={your_secret_access_key}
SET AWS_SESSION_TOKEN={your_session_token}
- Build associated python layer deployables
build_layers.bat
- Run
aws configure
- Bootstrap CDK
cdk bootstrap --context layer_arn=DUMMY --context layer_boto_arn=DUMMY --context XKEY=DUMMY --context debug_token=DUMMY
- [Skippable step]; originally, this project required an expiremental version of boto3 (v1.26.86) to support event bridge scheduling; however, at time of release, this was no longer required. This step initially required the manual creation of the boto3 package for layers. The zip file would be required to be placed in ./cloudpro_cdk/custom_packages/layers/boto_1.26_86.zip. Layers.py contains the now commented out code that referenced this file.
- Update destroy.bat and deploy.bat values for XKEY and debug_token to an alphanumeric 20+ character secure string. XKEY in destroy must match XKEY in deploy; debug_token in destroy must match debug_token in deploy.
- As an "initial staging", the lambda layers stack is required to be deployed.
deploy.bat cdk-layers-stack
- Deploy the full stack
deploy.bat *
- In AWS console, go to Amazon Simple Email Service (SES) and add the emails you which to utilize on the prototype to verified emails. https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html
- Confirm the verification email recieved
- Zip up your pro packs of choice (alternatively you can zip the skeleton PROs on staged_propacks\cpro). Each propack should be it's own individual zip
- Navigate to S3 on AWS console and create a raw/ folder within the bucket. Drop the zip files in here. Upload to cdk-propack-stack-bucketpropack (note there will be a randomly generated suffix to the bucket name)
- Validate extraction; cdk-propack-stack-bucketpropack will now have a folder called propack
- Validate database load by navigating to DynamoDB on AWS Console. This may take a few minutes for the event to trigger. Check cdk-dynamo-stack-dynamoquestionnaire & cdk-dynamo-stack-scoring tables. (note there will be a randomly generated suffix to the table name)
- Sync your API key from API gateway to the cloudfront distribution pointing to your api gateway (.execute-api.) by editting the origin and then updating DUMMY on x-api-key to the appropriate value. Save your changes. For convenience, you can now update your deploy/destroy script with this value.
- Your backend is deployed! Proceed to frontend deployment described in the appropriate branch (TLDR; update UI configs and perform s3deploy.bat cdk-userportal-stack-bucketuserportal)
- Manually create two cognito users to represent Surgeon 1 & Surgeon 2. Set email as verified and generate a password.
- Add
custom:isEmployee
attribute to both users with a value of1
- Add both to
surgeons
group - Update the sample JSON on hospitals & surgeon to reference the appropriate user sub id (staged_db_content\staging_hospitals.xlsx & staging_surgeons.xlsx)
- Create your entries in hospital and surgeon table
- Force change your two surgeon passwords to a secure random string via aws cli:
aws cognito-idp admin-set-user-password \
--user-pool-id <your-user-pool-id> \
--username <username> \
--password <password> \
--permanent
- Navigate to dynamodb and access the dynamoaggs table. Utilize aggs_t & aggs_spec json ((staged_db_content\staging_reporting.xlsx) to stage aggregates table (create the two items)
- Utilize reporting_sample to stage reporting for a patient user (must update sub)
Note: If on Linux:
chmod +x deploy.sh
./deploy.sh {argument}
Note: To execute an asterisk as your argument
./deploy.sh \*
"One click" deploy of CloudPRO.
-Bootstrap CDK -Set console access for AWS -Run build/deploy process
build_layers.bat
deploy cdk-layers-stack
deploy *
Please note, registration and login requires SES verified identities to be staged prior to testing as SES will be in Sandbox mode. Go to SES-> Verified identities and add the email addresses you will be testing with prior to executing login.
-- Boto 1.6.86 zip file created manually. Required to support some of the event bridge scheduler items. -- Be sure to check the API key on your cfront deployment (inserted DUMMY needs updated)
Detailed docs are housed in a separate repo.
Baseline was generated with CDK for Python.
The cdk.json
file tells the CDK Toolkit how to execute your app.
This project is set up like a standard Python project. The initialization
process also creates a virtualenv within this project, stored under the .venv
directory. To create the virtualenv it assumes that there is a python3
(or python
for Windows) executable in your path with access to the venv
package. If for any reason the automatic creation of the virtualenv fails,
you can create the virtualenv manually.
To manually create a virtualenv on MacOS and Linux:
$ python -m venv .venv
After the init process completes and the virtualenv is created, you can use the following step to activate your virtualenv.
$ source .venv/bin/activate
If you are a Windows platform, you would activate the virtualenv like this:
% .venv\Scripts\activate.bat
Once the virtualenv is activated, you can install the required dependencies.
$ pip install -r requirements.txt
At this point you can now synthesize the CloudFormation template for this code.
$ cdk synth
To add additional dependencies, for example other CDK libraries, just add
them to your setup.py
file and rerun the pip install -r requirements.txt
command.
cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation
Enjoy!