Skip to content

Instantly share code, notes, and snippets.

@mdfranz
Last active August 17, 2024 15:42
Show Gist options
  • Select an option

  • Save mdfranz/d739354ae3b9e5a23019ee5f16714f2c to your computer and use it in GitHub Desktop.

Select an option

Save mdfranz/d739354ae3b9e5a23019ee5f16714f2c to your computer and use it in GitHub Desktop.
Windmill Python Boto
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