Skip to content

Instantly share code, notes, and snippets.

@tayopal
Created December 7, 2022 22:29
Show Gist options
  • Save tayopal/7aa9ca64ade4c80ec633f2a27d66e4ef to your computer and use it in GitHub Desktop.
Save tayopal/7aa9ca64ade4c80ec633f2a27d66e4ef to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
import configparser
import os
aws_config_filepath = os.path.expanduser('~/.aws/config')
config = configparser.ConfigParser()
config.read(aws_config_filepath)
print(' '.join([x[8:] for x in config.sections() if x[8:] != os.environ.get('AWS_PROFILE')]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment