Parse your local "$HOME"/.aws/config
to use it within a Ruby script.
- Checkout this repo:
gh repo clone fac/aws_local_config_parser
- Run:
bin/setup
- Run:
bin/demo
See demo
for examples on how to use the gem.
Supports parsing and returning:
- Profiles with SSO
- Profiles with Access Key + Secret
- SSO Sessions
require 'aws_local_config_parser'
config = AwsLocalConfigParser.new
# Profile with SSO
my_sso_profile = config.profile('my-sso-profile-name')
my_sso_profile.sso_session
my_sso_profile.sso_account_id
my_sso_profile.sso_role_name
my_sso_profile.region
## Profile with Access Key + Secret
non_sso_profile = config.profile('my-non-sso-profile-name')
non_sso_profile.aws_access_key_id
non_sso_profile.aws_secret_access_key
non_sso_profile.region
## SSO Session
my_sso_session = config.sso_session('sso-session')
my_sso_session.sso_start_url
my_sso_session.sso_registration_scopes
my_sso_session.sso_region
## Listing all names
config.all_profiles
config.all_sso_sessions
Lefthook has been configured with pre-commit checks to:
- run
rubocop
for anyruby
files - run
actionlint
for any GitHub workflow files
If for some reason it's necessary, it's possible to temporarily skip lefthook
with: LEFTHOOK=0 git commit
.
Following Sematic Versioning, bump the version:
gem bump --version "<sem_ver_bump>"
and merge the changes tomain
- The Release and Build Gem wokflow will trigger a new version build
- Manually create a new release:
- Click on
Draft a new release
- In the
Choose a tag
dropdown, selecting the new version - Click
Generate release notes
and review the notes - Ensure
Set as the latest release
is checked - Click
Publish release
- Click on