agentleFS
epiccountyepiccounty/aws-toolkit/skills/aws-ssm/SKILL.md

aws-ssm

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

SSM Session Manager instance access, port-forwarding tunnels, remote command execution, and file transfer. Triggers: "ssm", "instance access", "인스턴스 접속", "tunnel", "터널", "port forwarding", "포트 포워딩", "rds 접속", "session manager".

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No scp over SSM. Route via S3:

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SSM Instance Access (no SSH)

Prerequisites:

  • session-manager-plugin installed — check: session-manager-plugin --version, else brew install --cask session-manager-plugin
  • Instance has ssm-instance-role attached
  • Instance allows outbound 443

List instances / open a shell

aws ssm describe-instance-information --profile epiccounty \
  --query 'InstanceInformationList[].[InstanceId,ComputerName,PingStatus,PlatformName]' --output table

aws ssm start-session --target <INSTANCE_ID> --profile epiccounty

Port-forwarding tunnels

# Instance-local port -> local (e.g. instance 80 -> local 8080)
aws ssm start-session --target <INSTANCE_ID> \
  --document-name AWS-StartPortForwardingSession \
  --parameters '{"portNumber":["80"],"localPortNumber":["8080"]}' \
  --profile epiccounty

# Remote host -> local (private RDS/Redis via instance as relay)
aws ssm start-session --target <INSTANCE_ID> \
  --document-name AWS-StartPortForwardingSessionToRemoteHost \
  --parameters '{"host":["<RDS_ENDPOINT>"],"portNumber":["3306"],"localPortNumber":["13306"]}' \
  --profile epiccounty

Tunnels block in the foreground — use a separate terminal or nohup for background.

Run commands without a session

aws ssm send-command --instance-ids <INSTANCE_ID> \
  --document-name AWS-RunShellScript \
  --parameters 'commands=["uptime","df -h"]' --profile epiccounty

aws ssm list-command-invocations --command-id <COMMAND_ID> --details --profile epiccounty

File transfer

No scp over SSM. Route via S3:

aws s3 cp <local-file> s3://<bucket>/staging/ --profile epiccounty
aws ssm send-command ... --parameters 'commands=["aws s3 cp s3://<bucket>/staging/<file> /tmp/"]'

Instance-side S3 access requires an extra policy on ssm-instance-role.

Launching instances (SSM-only pattern)

aws ec2 run-instances \
  --image-id resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 \
  --instance-type t3.micro \
  --iam-instance-profile Name=ssm-instance-role \
  --security-group-ids <SG_WITHOUT_PORT_22> \
  --profile epiccounty

Rules: no port 22 inbound, no key pair needed, access only via start-session.

Troubleshooting

SymptomCause / fix
Empty list / TargetNotConnectedRole not attached, outbound 443 blocked, agent down (systemctl status amazon-ssm-agent)
New instance missingRegistration takes a few minutes — wait
session-manager-plugin not foundReopen terminal after brew install

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.