npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ecs-pf

v2.2.27

Published

CLI for port-forwarding to RDS via AWS ECS

Readme

npm CI npm

AWS ECS-RDS Port Forwarding CLI

A modern CLI tool for connecting to RDS databases through AWS ECS tasks using SSM Session Manager.

Features

  • Port Forwarding: Easily forward RDS ports through ECS tasks
  • ECS Exec: Execute commands in ECS containers with interactive UI
  • Enable ECS Exec: Automatically enable ECS exec capability for services that need it

Quick Start

Interactive UI

npx ecs-pf connect

Example Usage

Interactive guided workflow

$ npx ecs-pf connect

Select Network Configuration
  Region      : ap-northeast-1
  RDS         : production-db
  (RDS port)  : 5432
  ECS Target  : api-task-abc123
  (ECS Cluster): production-cluster
  Local Port  : 8888

Connection established!
Database available at: localhost:8888

ECS Task Execution

Execute commands in ECS containers:

# Interactive mode
npx ecs-pf exec

# Direct execution
npx ecs-pf exec \
  --region ap-northeast-1 \
  --cluster production-cluster \
  --task arn:aws:ecs:ap-northeast-1:123456789:task/production-cluster/abcdef123456 \
  --container web \
  --command "/bin/bash"

# Dry run for exec commands
npx ecs-pf exec --dry-run \
  --region ap-northeast-1 \
  --cluster production-cluster \
  --task arn:aws:ecs:ap-northeast-1:123456789:task/production-cluster/abcdef123456 \
  --container web \
  --command "/bin/bash"

Enable ECS Exec

Enable ECS exec capability for services that don't have it enabled:

# Interactive mode - select services from all clusters
npx ecs-pf enable-exec --region ap-northeast-1

# Enable exec for specific service
npx ecs-pf enable-exec \
  --region ap-northeast-1 \
  --cluster production-cluster \
  --service api-service

# Enable exec for all services in a cluster
npx ecs-pf enable-exec \
  --region ap-northeast-1 \
  --cluster production-cluster

# Dry run to see what would be changed
npx ecs-pf enable-exec --dry-run \
  --region ap-northeast-1 \
  --cluster production-cluster \
  --service api-service

Prerequisites

Required AWS Setup

  1. ECS Exec enabled: Your ECS cluster and tasks must have ECS exec capability
  2. IAM permissions: Proper permissions for ECS, RDS, and SSM
  3. AWS CLI: Installed and configured with appropriate credentials
  4. Session Manager Plugin: Installed for AWS CLI

Development Requirements

  • Node.js: 24.11.1 (managed by mise)
  • To install mise: curl https://mise.run | sh
  • After installing mise, run mise install in the project directory

Troubleshooting

No ECS clusters found with exec capability

This means your clusters don't have ECS exec enabled. Enable it with our built-in command:

# Interactive mode to select and enable services
npx ecs-pf enable-exec --region your-region

# Or enable manually with AWS CLI
aws ecs update-service \
  --cluster your-cluster \
  --service your-service \
  --enable-execute-command

AWS CLI not found

# Check if AWS CLI is installed
aws --version

# Check if it's in PATH
which aws

Session Manager Plugin not found

# Check if Session Manager Plugin is installed
session-manager-plugin --version

Install it from: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html

Connection fails

  • Verify your ECS task is running and healthy
  • Check that RDS instance is accessible from the ECS task
  • Ensure security groups allow the connection
  • Verify IAM permissions for SSM and ECS exec

Development

Local Development

# Install dependencies
npm install

# Build the project
npm run build

# Run locally (interactive UI - default)
node dist/cli.js connect