How senk20/ec2connect works
ec2connect is a small Go CLI that selects an EC2 instance, ensures its requested TCP port is reachable from an allowed CIDR, runs the matching local SSH/SFTP/SCP client, and removes any temporary ingress rule afterward. The runtime is concentrated in main.go, so components share that path. The README documents the overall workflow; the excerpt shows config loading, connection execution, and cleanup dispatch, but omits some call sites, so undocumented internal links are not inferred.
Main entry points: main.go Command workflow
Components 10
CLI workflow
- Command workflow
main.go - Options and mode
main.go
Instance access
- AWS config loading
main.go - Instance selection
main.go - EC2 API
- Allowed CIDR
main.go - Security group rules
main.go
Connection session
- SSH SFTP SCP
Other components
- CLI user
- Public IP service
Connections 11
- CLI user → Command workflow: runs
README.md - Command workflow → Options and mode: parses
main.go - Command workflow → AWS config loading: loads
main.go - Command workflow → Instance selection: selects
README.md - Instance selection → EC2 API: queries
README.md - Command workflow → Allowed CIDR: determines
README.md - Allowed CIDR → Public IP service: requests IP
README.md - Command workflow → Security group rules: checks and updates
README.md - Security group rules → EC2 API: reads and changes
README.md - Command workflow → SSH SFTP SCP: runs session
main.go - Command workflow → Security group rules: cleans up rule
main.go