AWS Costs Money
Prior to running Terraform, create necessary environment variables
export DATABASE_PASSWORD="harnessisbest"
export SECURITY_GROUP="sg-abc123"
export SUBNET_GROUP="default-vpc-abc123"
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_SESSION_TOKEN=""
Disclaimer: Everyone's environment is different, you may need to tweak the Terraform to comply with your governance and/or security rules.
terraform init
terraform apply -var "database_password=$DATABASE_PASSWORD" -var "security_group=$SECURITY_GROUP" -var "subnet_group=$SUBNET_GROUP"
Once your DB is created by Terraform you will receive the endpoint information.
Rename config.ini.sample to config.ini and modify the values for host, port, user, and password as appropriate for your environment.
Run the Python loader script in a docker container. This can be done locally, but that approach is not recommended.
docker run -it -v $(pwd)/config.ini:/config.ini -v $(pwd)/init_aws_db.py:/init_aws_db.py --rm python:3.8.2 pip3 install psycopg2-binary ; python3 init_aws_db.py
This assumes you already have a Harness account and have a minimum of the free license enabled for Feature Flags
In the UI navigate to Feature Flags on the left-hand panel, and click into Environments on the submenu.
Click on + New Environment and create an environment called my_ff_environment. Leave the rest of the default values
and click create
Click + New SDK Key and create a server key called my_key, storing the value presented after creation in your
config.ini file under the section feature_flags as the value of key.
In the UI navigate to Feature Flags on the left-hand panel, and click into Feature Flags on the submenu.
Click + New Feature Flag, and select Boolean on the overlay that appears.
Enter the name migrate_to_rds and click Next.
On the following page leave all the default values as is and click Save and Close.
docker build -t harnessff:1 .
docker run -d -p 80:5000 --name harness_feature_flags harnessff:1
Navigate to http://localhost in your browser of choice. You will see our content that is currently hosted in SQLLite.
In the Harness UI, toggle your migrate_to_rds Feature flag.
Refresh the application page (localhost, not Harness itself) in your browser. You will now see CLOUD! appended in
front of the titles, showing the datasource has been cutover.






