This script lets you use 1Password to manage your AWS CLI credentials.
It provides two main functionalities:
- Allows the AWS CLI to source credentials directly from 1Password.
- Manages your
~/.aws/credentials
and~/.aws/config
files based on items stored in 1Password.
- Prepare your 1Password items
- Install and run
Your 1Password items must contain the following fields and tags:
Required:
access key id
secret access key
aws-cli-profile
Optional:
default-region
aws_cred_for_sourcing
-
Make sure the script is in your
${PATH}
. -
Run this script with the 'build_awc_cli_cred_file' argument:
./aws-cred-getter.sh build_awc_cli_cred_file
This will prepare your
~/.aws/credentials
and~/.aws/config
.This command can be run every time you add a new AWS cred. pair to your 1Password.