#aws #opensearch #sigv4

bin+lib aoss-curl

Request to Amazon OpenSearch Service with SigV4 🔏

39 releases (12 stable)

1.0.11 Jan 12, 2024
1.0.10 Dec 21, 2023
1.0.8 Nov 26, 2023
0.1.26 Jul 6, 2023
0.1.12 Nov 29, 2022

#919 in Command line utilities

Download history 69/week @ 2023-10-28 2/week @ 2023-11-04 2/week @ 2023-11-11 86/week @ 2023-11-18 173/week @ 2023-11-25 56/week @ 2023-12-02 13/week @ 2023-12-09 59/week @ 2023-12-16 78/week @ 2023-12-23 4/week @ 2023-12-30 60/week @ 2024-01-06 15/week @ 2024-01-13 2/week @ 2024-01-20 149/week @ 2024-01-27 160/week @ 2024-02-10

312 downloads per month

MIT license

21KB
442 lines

aoss-curl

Version Downloads License Build Release

Request to Amazon OpenSearch Service with SigV4 🔏

 aoss-curl
Request to Amazon OpenSearch Service with SigV4 🔏

Usage: aoss-curl <COMMAND>

Commands:
  no-auth  Request to Amazon OpenSearch Service with SigV4
  aws-mfa  Request to Amazon OpenSearch Service with SigV4 and aws-mfa
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Installation

aoss-curl is published on crates.io and can be installed with

cargo install aoss-curl

or via homebrew-tap with

brew install jhandguy/tap/aoss-curl

or downloaded as binary from the releases page.

Usage

no-auth

Run the aoss-curl no-auth command:

aoss-curl no-auth -u <opensearch_domain>/_cat/indices
200 OK
green ...

aws-mfa

aws-mfa can be used for authenticating to AWS with MFA before requesting to Amazon OpenSearch Service.

Config and credentials files

Add default region in ~/.aws/config:

[profile <profile_name>-noauth]
region = <aws_region>

[profile <profile_name>]
region = <aws_region>

Add basic credentials in ~/.aws/credentials:

[<profile_name>-noauth]
aws_access_key_id = <aws_access_key_id>
aws_secret_access_key = <aws_secret_access_key>

Note: make sure to add the -noauth suffix to the profile name

Run the aoss-curl aws-mfa file command:

aoss-curl aws-mfa file -p <profile_name> -c <mfa_code> -u <opensearch_domain>/_cat/indices
200 OK
green ...

Environment variables

Export default region and basic credentials as environment variables:

export AWS_REGION=<aws_region>
export AWS_ACCESS_KEY_ID=<aws_access_key_id>
export AWS_SECRET_ACCESS_KEY=<aws_secret_access_key>

Run the aoss-curl aws-mfa env command:

aoss-curl aws-mfa env -c <mfa_code> -u <opensearch_domain>/_cat/indices
200 OK
green ...

Dependencies

~20–32MB
~557K SLoC