Last active
August 17, 2024 15:42
-
-
Save mdfranz/d739354ae3b9e5a23019ee5f16714f2c to your computer and use it in GitHub Desktop.
Windmill Python Boto
This file contains hidden or 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 os | |
| import wmill | |
| import boto3 | |
| # see https://windmill.dev | |
| def main(): # Specify the parameter type as a dictionary | |
| aws_accounts = [] | |
| aws_accounts.append(wmill.get_resource("u/mdfranz/aws_9431")) | |
| aws_accounts.append(wmill.get_resource("u/mdfranz/aws_6473")) | |
| responses = [] | |
| for aws in aws_accounts: | |
| session = boto3.Session( | |
| aws_access_key_id=aws['awsAccessKeyId'], | |
| aws_secret_access_key=aws['awsSecretAccessKey'], | |
| region_name="us-east-1" | |
| ) | |
| sts_client = session.client('sts') | |
| response = sts_client.get_caller_identity() | |
| print(response) | |
| responses.append(response) | |
| return responses |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment