#!/bin/sh

cat cdk-output.json | jq '.Ec2SetupStack | to_entries | sort_by(.key) |.[] | select(.key | startswith("Student") and endswith("ipaddress")) | .key |=  scan("Student[0-9]+")' > IP.json
cat cdk-output.json | jq '.Ec2SetupStack | to_entries | sort_by(.key) |.[] | select(.key | startswith("Instructor") and endswith("ipaddress")) | .key |=  scan("Instructor")' >> IP.json

