Skip to content

CLI for forwarding requests to private API gateways in AWS.

License

Notifications You must be signed in to change notification settings

oscarbc96/agbridge

Repository files navigation

WIP agbridge CLI

Latest GitHub release Tests golangci-lint Go Report Card GitHub License

AGBridge is a command-line tool that acts as a proxy, forwarding requests to private API gateways running in AWS. It’s designed to handle API gateways that are not publicly accessible, allowing secure and efficient access to private resources. Ideal for debugging, testing, or integration scenarios, AGBridge prevents the need to expose sensitive resources while enabling smooth access.

AGBridge supports multiple API gateways simultaneously, making it suitable for integration testing across different services.

Usage

agbridge [flags]

Flags

Flag Description Default
--version Displays the application version and exits.
--config Path to a configuration file for AGBridge. This flag cannot be used with --profile-name, --rest-api-id, or --region.
--profile-name Specifies the AWS profile name to access resources. Requires --rest-api-id and --region to be specified.
--rest-api-id Specifies the Rest API ID of the AWS API gateway. Required if --config is not provided.
--region Specifies the AWS region for the API gateway. Requires --rest-api-id and --profile-name.
--log-level Sets the logging level for output messages. Options: debug, info, warn, error, fatal. info
--listen-address Address where AGBridge will listen for incoming requests. Format should be host:port. :8080

Examples

Specify API GW with Profile

Specify a resource and profile to access a private API gateway:

agbridge --profile-name=myprofile --rest-api-id=12345

Load a Specific Configuration File

Run AGBridge with a configuration file:

agbridge --config=config.yaml

Change Listen Address

Set a custom port for AGBridge to listen on:

agbridge --listen-address=:9090

Installation

Option 1: Using Homebrew

  1. Add the Homebrew tap:
     brew tap oscarbc96/agbridge [email protected]:oscarbc96/agbridge.git
  2. Install:
    brew install agbridge

Option 2: Download from Releases

  1. Visit the Releases page on GitHub.
  2. Download the appropriate binary for your operating system.
  3. Make the binary executable (if on Linux or macOS):
    chmod +x agbridge

Option 3: Using Docker

  1. Pull the latest Docker image:
    docker pull ghcr.io/oscarbc96/agbridge:latest
  2. Run the container with appropriate flags. For example:
    docker run --rm -it -p 8080:8080 ghcr.io/oscarbc96/agbridge:latest --profile-name=myprofile --rest-api-id=12345 --listen-address=:8080

Option 4: Build from Source

  1. Clone the repository:
    git clone https://github.com/oscarbc96/agbridge
    cd agbridge
  2. Build the CLI:
    make snapshot
  3. Run the CLI:
    dist/agbridge