Skip to content

AWS Service Authentication Tool (awsat) is a cross-platform CLI that automates AWS CodeArtifact and ECR authentication tokens—streamlining your login workflow. Available as a .NET global tool, it supports Windows, macOS, and Linux with detailed logging for easy auditing and troubleshooting.

License

Notifications You must be signed in to change notification settings

karimz1/AWS-Service-Authentication-Tool

Repository files navigation

awsat (AWS Service Authentication Tool)

Build, Release, and Publish to NuGet NuGet version (awsat)

Overview

Welcome to the AWS Service Authentication Tool, a cross-platform CLI tool for managing AWS CodeArtifact and ECR authentication tokens. This tool simplifies the process of logging into AWS services and managing authentication credentials.

Features

  • Authenticate AWS CodeArtifact repositories.
  • Authenticate Docker with AWS ECR.
  • Cross-platform compatibility (Windows, macOS, and Linux).
  • Detailed logging for auditing and debugging.

Installation

To install the AWS Service Authentication Tool as a global .NET tool, run:

dotnet tool install --global awsat

Usage

Run the tool with the desired command:

awsat --command nuget --region us-east-1 --logFolderPath ./logs

Available Commands

  • nuget: Refreshes authentication tokens for AWS CodeArtifact.
  • ecr: Refreshes authentication tokens for AWS ECR.

Command-Line Options

Option Description Required
-c, --command Command to execute (nuget or ecr). Yes
-r, --region AWS region to use (e.g., us-east-1). Yes
-l, --logFolderPath Path to the log file. Yes
-d, --debugMode Enable debug mode for detailed logging. No

Example Usage

  1. Authenticate AWS CodeArtifact:

    awsat --command nuget --region us-east-1 --logFolderPath ./logs
  2. Authenticate AWS ECR:

    awsat --command ecr --region us-east-1 --logFolderPath ./logs

Automating Authentication

To automate token refreshing, integrate this tool with your system's task scheduler.

Cron Job Example (Linux/macOS)

  1. Open your crontab configuration:

    crontab -e
  2. Add the following line to refresh tokens at startup:

    @reboot awsat --command nuget --region us-east-1 --logFolderPath /path/to/logs

Task Scheduler Example (Windows)

  1. Open Task Scheduler and create a new task.

  2. Set the trigger to run at login.

  3. Set the action to execute:

    awsat --command nuget --region us-east-1 --logFolderPath C:\path\to\logs

Configuration

Environment Prerequisites

  • AWS CLI: Installed and configured with valid credentials. Refer to the AWS CLI Configuration Guide.
  • Docker: Installed for ECR authentication. Refer to Docker Installation Guide.

Additional Resources


❤️ Supporting the Project ❤️

If you find this project useful, please consider supporting its development. Donations are appreciated and help maintain and improve this tool.

PayPal: mails.karimzouine@gmail.com


Development

Detailed build and development instructions are now in the DEVELOPMENT.md file.


License

This project is licensed under the MIT License. See the LICENSE file for details.


About

AWS Service Authentication Tool (awsat) is a cross-platform CLI that automates AWS CodeArtifact and ECR authentication tokens—streamlining your login workflow. Available as a .NET global tool, it supports Windows, macOS, and Linux with detailed logging for easy auditing and troubleshooting.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published