aws-export-format
v1.0.4
Published
This script will take json and will return export access token commands for AWS CLI
Maintainers
Readme
AWS Export Format
aws-export-format is a simple CLI tool that takes a JSON input containing AWS credentials and generates export commands for the AWS CLI. This is particularly useful for quickly setting up environment variables for AWS CLI sessions.
Installation
You can use this package directly with npx. No need to install it globally.
npx aws-export-formatIf you're using it for the first time, you may need to confirm the installation by typing yes.
Usage
- Run the command:
npx aws-export-format- Paste your JSON input.
{
"Credentials": {
"AccessKeyId": "your-access-key-id",
"SecretAccessKey": "your-secret-access-key",
"SessionToken": "your-session-token"
}
}Press Enter twice after pasting the JSON input.
The tool will output the export commands for setting up your AWS environment variables:
export AWS_ACCESS_KEY_ID=your-access-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-access-key
export AWS_DEFAULT_REGION=ap-south-1
export AWS_SESSION_TOKEN=your-session-token- Copy and paste these commands into your terminal to set up the environment variables.
Example
$ npx aws-export-format
Please enter the JSON input (press Enter twice when done):
{
"Credentials": {
"SecretAccessKey": "secret-access-key",
"SessionToken": "temporary-session-token",
"Expiration": "expiration-date-time",
"AccessKeyId": "access-key-id"
}
}
export AWS_ACCESS_KEY_ID=access-key-id
export AWS_SECRET_ACCESS_KEY=secret-access-key
export AWS_DEFAULT_REGION=ap-south-1
export AWS_SESSION_TOKEN=temporary-session-tokenLicense
This project is licensed under the MIT License. See the LICENSE file for details.
