https://github.com/jhandguy/aoss-curl
Request to Amazon OpenSearch Service with SigV4 🔏
https://github.com/jhandguy/aoss-curl
aws opensearch rust sigv4
Last synced: 6 months ago
JSON representation
Request to Amazon OpenSearch Service with SigV4 🔏
- Host: GitHub
- URL: https://github.com/jhandguy/aoss-curl
- Owner: jhandguy
- License: mit
- Created: 2022-10-30T19:26:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T19:03:38.000Z (about 2 years ago)
- Last Synced: 2024-04-14T09:45:22.906Z (about 2 years ago)
- Topics: aws, opensearch, rust, sigv4
- Language: Rust
- Homepage:
- Size: 324 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aoss-curl
[](https://crates.io/crates/aoss-curl)
[](https://crates.io/crates/aoss-curl)
[](LICENSE)
[](https://github.com/jhandguy/aoss-curl/actions/workflows/ci.yaml)
[](https://github.com/jhandguy/aoss-curl/actions/workflows/cd.yaml)
Request to Amazon OpenSearch Service with SigV4 🔏
```shell
➜ aoss-curl
Request to Amazon OpenSearch Service with SigV4 🔏
Usage: aoss-curl
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](https://crates.io/crates/aoss-curl) and can be installed with
```shell
cargo install aoss-curl
```
or via [homebrew-tap](https://github.com/jhandguy/homebrew-tap) with
```shell
brew install jhandguy/tap/aoss-curl
```
or downloaded as binary from the [releases page](https://github.com/jhandguy/aoss-curl/releases).
## Usage
### no-auth
Run the `aoss-curl no-auth` command:
```shell
aoss-curl no-auth -u /_cat/indices
```
```text
200 OK
green ...
```
### aws-mfa
[aws-mfa](https://github.com/jhandguy/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`:
```text
[profile -noauth]
region =
[profile ]
region =
```
Add basic credentials in `~/.aws/credentials`:
```text
[-noauth]
aws_access_key_id =
aws_secret_access_key =
```
> **Note**: make sure to add the `-noauth` suffix to the profile name
Run the `aoss-curl aws-mfa file` command:
```shell
aoss-curl aws-mfa file -p -c -u /_cat/indices
```
```text
200 OK
green ...
```
#### Environment variables
Export default region and basic credentials as environment variables:
```shell
export AWS_REGION=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
```
Run the `aoss-curl aws-mfa env` command:
```shell
aoss-curl aws-mfa env -c -u /_cat/indices
```
```text
200 OK
green ...
```