This repository is for the Developer Kit.
In this step, please use the mec-stack
directory.
- Ensure your AWS Account is opted-in for WLZs. You can do this on the EC2 Dashboard page (Zones --> Enable additional Zones).
- Follow the AWS CDK Documentation to setup the AWS CLI and AWS CDK for TypeScript.
- Update
bin/mec.ts
with your desired configuration (i.e. AZ, WLZ, Key-Pair, CIDR Blocks, AMIs, and Instance Types) andlib/mec-stack.ts
with the correct Security Group rules for your instances. - Build the stack.
npm install && npm run build
- Deploy the stack.
cdk deploy MecStackDFW
- [Optional] If the CDK is failing due to Subnet and Route Table Associations, delete the stack manually in the CFN console, comment out the occurances of the
ec2.CfnSubnetRouteTableAssociation()
function call, and build/deploy the CFN stack. Once the deployment is complete, recomment those function calls back in and build/deploy the CFN stack.
# Update your ~/.ssh/config with the following
Host bastionhost
Hostname [INSERT BASTION HOST PUBLIC IP]
user ubuntu
IdentityFile [INSERT PATH TO KEY-PAIR FILE]
Port 22
ForwardAgent yes
ServerAliveInterval 240
LogLevel DEBUG
# [Optional] Clean your ssh-add keys
ssh-add -D
# Add the KEY-PAIR to your SSH keys
ssh-add [INSERT PATH TO KEY-PAIR FILE]
# Confirm the KEY-PAIR was added
ssh-add -l
# Connect to the bastion host
ssh bastionhost
# Connect to the private EC2 Instances
ssh -v ubuntu@[INSERT EC2 INSTANCE PRIVATE IP]
npm install
download package and it's dependenciesnpm run build
compile typescript to jsnpm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
In this step, please use the mec-stack
directory.
- Follow the AWS CDK Documentation to setup the AWS CLI and AWS CDK for TypeScript.
- Build the stack.
- Update
bin/mec.ts
with your desired configuration (i.e. AZ, Key-Pair, CIDR Blocks, AMIs, and Instance Types) andlib/ec2-instance-stack.ts
with the correct Security Group rules for your instances.
npm install && npm run build
- Deploy the stack.
cdk deploy EC2InstanceStack
In this step, please use the jwks-server
directory.
- Use https://mkjwk.org/ to create your JWK (JSON Web Key).
- Use https://8gwifi.org/jwkconvertfunctions.jsp to convert your JWK into a RSA PEM encoded public and private key.
- SSH into the EC2 instance your provisioned in Step 2.
- Clone the
jwks-server
directory onto the EC2 instance. - Update the public key with the public key from the JWK you created in Step 3.1.
- Run the Flask Server. You can either execute
make python
to run the Flask App using Python, or executemake build
to build the Flask App in a Docker Container and thenmake run
to launch the Docker Container.
In this step, please use the developer-kit
directory.
- Update the
.env
with your specific configuration. Note that the private key must be the matching private key for the public key you created in Step 3.2. - Run the Flask Server. You can either execute
make python
to run the Flask App using Python, or executemake build
to build the Flask App in a Docker Container and thenmake run
to launch the Docker Container. - Update the files in the
config
directory and then begin interacting with the server using the commands below.
You can either execute the demo.sh
script or execute the following commands:
# Create a Purpose
curl \
-d '@config/purpose_config.json' \
-H 'Content-Type: application/json' \
-X POST \
'http://127.0.0.1/purposes'
# Get a Purpose
curl \
-X GET \
'http://127.0.0.1/purposes/[INSERT PURPOSE ID]'
# Delete a Purpose
curl \
-X DELETE \
'http://127.0.0.1/purposes/[INSERT PURPOSE ID]'
# Create a App
curl \
-d '@config/app_config.json' \
-H 'Content-Type: application/json' \
-X POST \
'http://127.0.0.1/apps'
# Get a App
curl \
-X GET \
'http://127.0.0.1/apps/[INSERT APP ID]'
# Delete a App
curl \
-X DELETE \
'http://127.0.0.1/apps/[INSERT APP ID]'
# Create a QoD Session
curl \
-d '@config/qod_config.json' \
-H 'Content-Type: application/json' \
-X POST \
'http://127.0.0.1/connectivity'
# Get a QoD Session
curl \
-X GET \
'http://127.0.0.1/connectivity/[INSERT SESSION ID]'
# Delete a QoD Session
curl \
-X DELETE \
'http://127.0.0.1/connectivity/[INSERT SESSION ID]'
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.