Skip to content

Instantly share code, notes, and snippets.

@rernst76
rernst76 / ssmportforward.py
Last active March 6, 2025 15:25
boto3 SSM PortForwarding
"""
How to use boto3 for SSM local port forwarding.
In this example we are connecting to a MongoDB instance, but
the idea is the same regardless of connection.
"""
import os
import subprocess
import json
import boto3