This repository comprises a cloud-based implementation of the Ethical Transparency Tool for The Societies Consortium on Sexual Harassment in STEMM as described in the Overview Briefing Packet. This implementation is designed for hosting on AWS and built completely around AWS serverless technologies.
This diagram depicts the basic arrangement of services and the sequencing a request made by a single page app client makes in order to access backend services (database, emailing, events, etc.)
- AWS CDK
- AWS CLI
- Node & NPM
- Git
- Visual Studio Code
- Admin role for target account (ie: Shibboleth-InfraMgt/[email protected], for the BU CSS account)
Build the entire application and AWS infrastructure from scratch.
-
Clone this repository
-
Modify the
./context/context.jsonfile. You will probably only adjust 2 or 3 of the attributes in this file - a breakdown of all attributes are here -
Obtain security credentials for the admin-level IAM role you will be using for accessing the aws account to lookup and/or deploy resources. Create a named profile out of these credentials in your
~/.aws/credentialsfile. -
Install all dependencies:
for line in $(find . -maxdepth 4 -name package.json -print | grep -v '/node_modules/') ; do (cd $(dirname $line) && npm install); done \; -
Bootstrapping is the process of provisioning resources for the AWS CDK before you can deploy AWS CDK apps into an AWS environment. (An AWS environment is a combination of an AWS account and Region). You only need to bootstrap once for your chosen region within your account. The presence of a
"CDKToolKit"cloud-formation stack for that region will indicate bootstrapping has already occurred. To bootstrap, follow these steps. The simple bootstrapping command is:export AWS_PROFILE=my_named_profile cdk bootstrap aws://[aws account ID]/us-east-1 -
[OPTIONAL] Run the CDK synth command command to generate the cloudformation template that will be used to create the stack:
mkdir ./cdk.out 2> /dev/null cdk synth &> cdk.out/ett.template.yamlNOTE: The synth command will create a .json file, but will also output yaml to stdout. The command above redirects that output to a yaml file alongside the json file.
-
[OPTIONAL] Debug synthesis with breakpoints: If developing in vscode, add the following debug configuration to the
${workspaceFolder}/.vscode/launch.jsonfile if it does not already exist:{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "CDK Debugger (App)", "skipFiles": ["<node_internals>/**"], "runtimeArgs": ["-r", "./ett-auth/node_modules/ts-node/register/transpile-only"], "args": ["${workspaceFolder}/ett-auth/bin/ett.ts"] } ] }Place a breakpoint at the desired location and run the launch configuration.
-
Enable API Gateway Logging for the account. Follow these directions
-
Run the CDK deploy command to create the stack:
npm run deployor to completely tear down and replace a stack without prompts use:
npm run redeploy