Created
October 15, 2021 02:37
-
-
Save akloya/6c95ee49bb0ea5cdfb866007791c71f0 to your computer and use it in GitHub Desktop.
loop through multiple aws profiles in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
for profile in ['profile1', 'profile2']: | |
print("fetching from account => " + profile) | |
session = boto3.session.Session() | |
client = session.client( | |
service_name='secretsmanager', | |
region_name='us-west-2' | |
) | |
response = client.list_secrets() | |
print(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment