Code to deploy AWS LI Hydro surveys infrastructure.
The result of deploying this should be a stack called "HydroSurveyStack" containing the following:
- A landing zone bucket where survey providers can upload their surveys.
- A processing bucket where Hydro employees can work on surveys.
- A consumption bucket where the public can retrieve survey processing outputs.
Prerequisites:
- Install and configure Node Version Manager
- Run
nvm install && nvm use
within this project root to use the configured Node.js version. Repeat this and following steps when.nvmrc
changes. - Install packages (repeat when
package-lock.json
changes):- Generate a new GitHub personal access token (PAT) with the access "read:packages".
- Run
export NODE_AUTH_TOKEN=[the PAT value]
to allow access to install private packages from GitHub within the current shell. - If you're just deploying and not doing development, run
npm install --omit=dev
to install only production packages. - If you're doing development:
- Run
npm install
to install all packages. - Optionally install
pre-commit
, then runpre-commit install --hook-type=commit-msg --hook-type=pre-commit --overwrite
to install the hooks which will automatically lint and format files when committing, and verify commit messages.
- Run
Authenticate using aws-azure-login --no-prompt --profile="$AWS_PROFILE"
, where $AWS_PROFILE
is the name of one of the profiles in your ~/.aws/config
file.
npm run cdk diff -- --fail --strict
compares the deployed stack with the current state.npm run cdk deploy -- --method=direct --strict
deploys this stack.
Beware: You must run commands like npm run RUN_OPTIONS COMMAND -- COMMAND_OPTIONS
(note the --
). npm run RUN_OPTIONS COMMAND COMMAND_OPTIONS
(without the --
) will not do what you expect - all options will be treated like npm run
options!
npm run build
compiles TypeScript to JavaScript.npm run watch
compiles files when files change.npm run lint
checks file formatting.npm run test
runs the tests.npm run cdk synth
emits the synthesized CloudFormation template.pre-commit run --all-files
runs other linters and formatters manually.