Skip to content

awsctl is a CLI tool designed to simplify AWS environment access and resource management using AWS Single Sign-On (SSO). It provides interactive commands to configure profiles, SSH/SSM into bastion hosts, manage RDS connections, update EKS configurations, and login to ECR.

License

Notifications You must be signed in to change notification settings

BerryBytes/awsctl

AWS CLI Tools πŸ”§

Table of Contents πŸ“‹

Overview

awsctl is a CLI tool designed to simplify AWS environment access and resource management using AWS Single Sign-On (SSO). It provides interactive commands to configure profiles, SSH/SSM into bastion hosts, manage RDS connections, update EKS configurations, and login to ECR.

AWS CLI leverages the powerful Cobra framework to build a robust and user-friendly command-line interface.

Requirements

System Requirements

  • OS:
    • Linux (Kernel 4.17+)
    • macOS (10.13+)
    • Windows ( limited support )
  • Architecture: x86_64 or ARM64

Dependencies

Dependency Version Installation Guide Verification Command
Go 1.20+ Go Installation go version
AWS CLI v2 with SSO support AWS CLI Installation aws --version
Session Manager Plugin Latest Session Manager Plugin session-manager-plugin --version
kubectl Latest kubectl Installation kubectl version --client
Docker Latest Docker Installation docker --version
ssh Latest OpenSSH Installation ssh -V

Notes:

  • You need an AWS account with SSO enabled and appropriate permissions to configure SSO profiles.
  • Installation commands like sudo apt install -y kubectl or sudo apt install -y docker.io are Ubuntu-specific. For other systems (e.g., macOS, Windows, or other Linux distributions), refer to the linked installation guides.
  • The ssh (OpenSSH client) is typically pre-installed on Linux and macOS. If not, install it on Debian-based systems with sudo apt install -y openssh-client or use the equivalent for your OS.

Features

  • SSO Authentication: Log in and manage AWS SSO profiles with a single command, ensuring secure access to AWS resources.

  • Bastion/EC2 SSH Access: Connect to bastion hosts or EC2 instances via SSH or SSM with automated session setup.

  • Port Forwarding & SOCKS Proxy: Access internal AWS resources securely using dynamic port forwarding or a SOCKS5 proxy for flexible networking.

  • RDS Connectivity: Connect to RDS databases directly or via SSH/SSM tunnels, supporting both direct endpoints and secure tunneling.

  • EKS Cluster Management: Update your local kubeconfig to access Amazon EKS clusters in seconds, simplifying Kubernetes workflows.

  • ECR Authentication: Authenticate to Amazon ECR with SSO credentials to securely push and pull container images.

Installation

Releases

  • Check out the latest releases at GitHub Releases. You can also install the awsctl using following command.
  1. To install the latest version.
curl -sS https://raw.githubusercontent.com/berrybytes/awsctl/main/installer.sh | bash
  1. To install specific version (e.g: v0.0.1)
curl -sS https://raw.githubusercontent.com/berrybytes/awsctl/main/installer.sh | bash -s -- v0.0.1

Manual

  1. Clone this repository
git clone [email protected]:BerryBytes/awsctl.git
  1. Make the install-awsctl.sh executable:
chmod +x install-awsctl.sh
  1. Run the startup script:
  • First Time Installation

    If this is your first time installing, use the source command:
source ./install-awsctl.sh

This ensures environment changes (like PATH updates) take effect immediately.

Why use source?

  • Executes in current shell session
  • Updates environment variables immediately
  • No terminal restart required

For Updates

Run normally:

./install-awsctl.sh

Usage

Start with awsctl --help OR awsctl -h to get started.

Configuration File

  • The awsctl sso setup command checks for a configuration file at ~/.config/awsctl/ (supported formats: config.json, config.yml, or config.yaml). If none exists, new configuration will be setup.

  • Below is sample config.yaml file in:

ssoSessions:
  - name: "sso-session-1"
    startUrl: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    region: "XX-XXXX-X"
  - name: "sso-session-2"
    startUrl: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    region: "XX-XXXX-X"
    scopes: "sso:account:access"

Note: scopes can be empty. Default value will be sso:account:access

Commands

The following table summarizes the available awsctl commands:

Command Description
awsctl sso setup Creates/updates AWS SSO profiles. Supports flags: --name, --start-url, --region for non-interactive setup. Uses ~/.config/awsctl/config.yml if available; otherwise, you will be prompted to enter the SSO Start URL, Region and SSO Name. The selected profile is then set as the default and authenticated.
awsctl sso init Starts SSO authentication by allowing you to select from existing AWS SSO profiles (created via awsctl sso setup). Useful for switching between multiple configured SSO profiles.
awsctl bastion Manages SSH/SSM connections, SOCKS proxy, or port forwarding to bastion hosts or EC2 instances.
awsctl rds Connects to RDS databases directly or via SSH/SSM tunnels.
awsctl eks Updates kubeconfig for accessing Amazon EKS clusters.
awsctl ecr Authenticates to Amazon ECR for container image operations.

For detailed CLI command usage, see Command Usage Documentation.

Contributing

We welcome contributions! Please see our contributing guidelines for more details.


πŸ‘₯ Community

Join our vibrant Discord community to connect with contributors and maintainers. Engage in meaningful discussions, collaborate on ideas, and stay updated on the latest developments!

Code Review Automation

This project uses Coderabbit AI to assist with pull request reviews.

Role: Automatically reviews pull requests for code quality, potential bugs, best practices, and documentation gaps.

How it works:

  • Summarizes PR changes.
  • Provides line-by-line suggestions.
  • Offers codebase-wide analysis.

Note: Suggestions by Coderabbit are recommendations. Final review decisions are made by maintainers.

Releasing

To trigger a release, push a commit to main with [release] in the commit message (e.g., git commit -m "Add feature [release]"). The workflow will auto-increment the version, tag it, and create a draft release.

Credits

Special thanks to Berrybytes for bringing this project to life!

License

AWSCTL CLI Tools is open-source software licensed under the MIT License.

This revised README is more visually appealing and user-friendly while maintaining its clarity and professionalism.

About

awsctl is a CLI tool designed to simplify AWS environment access and resource management using AWS Single Sign-On (SSO). It provides interactive commands to configure profiles, SSH/SSM into bastion hosts, manage RDS connections, update EKS configurations, and login to ECR.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5