Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/gdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@ This guide covers deploying the component using the Greengrass Development Kit

## Prerequisites

- [GDK CLI](https://github.com/aws-greengrass/aws-greengrass-gdk-cli) installed
- [GDK CLI](https://github.com/aws-greengrass/aws-greengrass-gdk-cli)
- Follow Install GDK step below if not installed already.
- AWS credentials configured
- Easiest is to export a permissive role's token
- S3 bucket for component artifacts
- Built binaries (see [BUILD.md](BUILD.md))
- Built localproxy binary (see [localproxy.md](localproxy.md))

Install GDK:

```sh
pip3 install git+https://github.com/aws-greengrass/aws-greengrass-gdk-cli.git@v1.6.0
```

Exporting AWS Credentials

```shell
export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
export AWS_SESSION_TOKEN=<AWS_SESSION_TOKEN>
```

## Configuration

Edit `gdk-config.json`:
Expand Down
38 changes: 21 additions & 17 deletions docs/localproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
## Overview

This component requires a prebuilt
[localproxy binary](https://github.com/aws-samples/aws-iot-securetunneling-localproxy/tree/main)
[localproxy binary version >=v3.2.0](https://github.com/aws-samples/aws-iot-securetunneling-localproxy/tree/main)
from AWS IoT Secure Tunneling.

Tested with
[commit feb59e2](https://github.com/aws-samples/aws-iot-securetunneling-localproxy/commit/feb59e268c8f4f1c7450f3a510963e84cc397ac7).

If you want arm64, arm7l or x86 linux build these are available as pre-built
binaries with the repo's
[latest release](https://github.com/aws-samples/aws-iot-securetunneling-localproxy/releases/).
Expand All @@ -22,24 +19,31 @@ target device. For cross-compilation, see the
### Install Dependencies

```sh
sudo apt update

# Install boost 1.87
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz -O /tmp/boost_1_87_0.tar.gz
tar xzvf /tmp/boost_1_87_0.tar.gz
cd boost_1_87_0
./bootstrap.sh
sudo ./b2 install link=static

# Install other dependencies
sudo apt install zlib1g protobuf-compiler libprotobuf-dev libssl-dev
sudo apt-get update && sudo apt-get install -y build-essential cmake wget git libssl-dev zlib1g-dev

# Install Boost 1.87.0
wget -q https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz -O boost.tar.gz
tar xzf boost.tar.gz && cd boost_1_87_0
./bootstrap.sh --prefix=/usr/local
sudo ./b2 install link=static -j$(nproc)
cd ..

# Install Protobuf 3.17.3
wget -q https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz -O protobuf.tar.gz
tar xzf protobuf.tar.gz && cd protobuf-3.17.3
mkdir -p build && cd build
cmake ../cmake -DCMAKE_INSTALL_PREFIX=/usr/local -Dprotobuf_BUILD_TESTS=OFF
make -j$(nproc) && sudo make install
cd ../..
```

### Build

```sh
cmake -B build -DCMAKE_BUILD_TYPE=Release -DLINK_STATIC_OPENSSL=OFF -DBUILD_TESTS=OFF
make -C build/
mkdir -p build && cd build
cmake .. -DBUILD_TESTS=OFF -DLINK_STATIC_OPENSSL=OFF
make -j$(nproc)
strip bin/localproxy
```

The resulting binary should be approximately 4MB.
Expand Down
33 changes: 33 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ Once deployed, create tunnels via the AWS Console:
4. Wait for connection to establish
5. Access your device through the web UI

## AWS CLI Alternative

Create a tunnel:

```bash
aws iotsecuretunneling open-tunnel \
--destination-config thingName=<YOUR_THING_NAME>,services=SSH
```

List tunnels:

```bash
aws iotsecuretunneling list-tunnels
```

Describe a tunnel:

```bash
aws iotsecuretunneling describe-tunnel --tunnel-id <TUNNEL_ID>
```

Close a tunnel:

```bash
aws iotsecuretunneling close-tunnel --tunnel-id <TUNNEL_ID>
```

Connect using localproxy with the source access token:

```bash
./localproxy -r <REGION> -s <SOURCE_ACCESS_TOKEN> -d localhost:22
```

## Additional Resources

- [AWS Secure Tunneling Tutorial](https://docs.aws.amazon.com/iot/latest/developerguide/tunneling-tutorial-quick-setup.html)
2 changes: 2 additions & 0 deletions misc/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DBUILD
DCMAKE
DEPENDS
DLINK
Dprotobuf
endforeach
endif
endmacro
Expand All @@ -28,6 +29,7 @@ GLIBCXX
greengrass
greengrassv2
INTERPROCEDURAL
iotsecuretunneling
iwyu
journalctl
libc
Expand Down