NOAA-OWP / hydrovis

Other
7 stars 3 forks source link

# Overview

The Hydrologic Visualization and Information Services (HydroVIS) project aims to process and disseminate hydrologic data through the AWS public cloud. The HydroVIS visualization process pipeline (VPP) ingests forecast data from the National Water Model (NWM) and River Forecasting Centers (RFC), analyzes the data, and then creates products and services that are disseminated through an AWS hosted GIS platform.

This repo contains all the infrastructure as code (IaC) used to create and setup AWS services for the HydroVIS VPP.



Terms


Usage

Dependencies
- `terraform (v1.2.0+)` - `aws-cli (v2.5.6+)`
Initial Setup
Before you can perform deployments to the HydroVIS environment you will need to do the following: ### Setting up the Codebase 1. Clone this repository to your deployment machine. 2. Clone the private ENV storage repository into a folder called `sensitive` at the root of your local copy of this repository. ### Setting up the AWS CLI 1. Download and Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) 2. You will need to configure an AWS profile for each of the corresponding `ENV_REGION` combination you will be deploying to. [Here](https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html) are the instuctions on how to set up AWS CLI profiles to use SSO credentials. Simply follow the instructions and name the profiles as the environment and region names. ### Setting up Terraform 1. Download and Install the [Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli#install-cli) CLI tool. 2. Navigate to `/Core` in your local copy of this repository. 3. Run `aws sso login --profile TF_STATE_ENV`. 4. Run `terraform init`. This will initialize the remote state backend to give you access to the terraform workspaces for all the cloud environments.


The following is the deployment process for updating a given HydroVIS environment. The steps are identical regardless of which environment you are deploying to.


Troubleshooting

Generally, Terraform is very good at telling you where exactly an issue is when you run the terraform plan command. Simply go to the file and line number provided in the console output and investigate. Terraform has excellent documentation, so you can go to the AWS Provider documentation here to get details on all of the terraform resources.

If Terraform fails during the terraform apply command, first try re-running the plan and apply commands to see if the issue resolves itself. This issue sometimes happens due to race-conditions on Terraform resource dependencies.


Specific Errors

Error: error configuring S3 Backend: no valid credential sources for S3 Backend found.

Description: This error message means that you need to re-authenticate with the AWS environment that stores the Terraform Remote State.

Solution: $ aws sso login --profile TF_STATE_ENV



Development

The workflow for developing new features in HydroVIS is as follows: