Skip to main content

Cloud Auxiliary is a python wrapper and orchestration module for interacting with cloud providers

Project description

# cloudaux
Cloud Auxiliary is a python wrapper and orchestration module for interacting with cloud providers

## Features

- intelligent connection caching.
- handles pagination for certain client methods.
- rate limit handling, with exponential backoff.
- multi-account sts:assumerole abstraction.
- orchestrates all the calls required to fully describe an item.

## Orchestration Supported Technologies

- IAM Role
- IAM User

## Example

# Using wrapper methods:
from import get_queue, get_messages
conn_details = {
'account_number': '111111111111',
'assume_role': 'MyRole',
'session_name': 'MySession',
'region': 'us-east-1'
queue = get_queue(queue_name='MyQueue', **conn_details)
messages = get_messages(queue=queue)

# Using the CloudAux class
from cloudaux import CloudAux
CloudAux.go('kms.client.list_aliases', **conn_details)

ca = CloudAux(**conn_details)'kms.client.list_aliases')

# directly asking for a boto3 connection:
from import boto3_cached_conn
conn = boto3_cached_conn('ec2', **conn_details)

# Over your entire environment:
from cloudaux.decorators import iter_account_region

accounts = ['000000000000', '111111111111']

conn_details = {
'assume_role': 'MyRole',
'session_name': 'MySession',
'conn_type': 'boto3'

@iter_account_region('kms', accounts=accounts, regions=['us-east-1'], **conn_details)
def list_keys(conn=None):
return conn.list_keys()['Keys']

## Orchestration Example

from import get_role

# account_number may be extracted from the ARN of the role passed to get_role
# if not included in conn.
conn = dict(
assume_role='SecurityMonkey', # or whichever role you wish to assume into

role = get_role(
dict(arn='arn:aws:iam::000000000000:role/myRole', role_name='myRole'),
output='camelized', # optional: {camelized underscored}

# cloudaux makes a number of calls to obtain a full description of the role
print(json.dumps(role, indent=4, sort_keys=True))

"Arn": ...,
"AssumeRolePolicyDocument": ...,
"CreateDate": ..., # str
"InlinePolicies": ...,
"InstanceProfiles": ...,
"ManagedPolicies": ...,
"Path": ...,
"RoleId": ...,
"RoleName": ...,
"_version": 1 # Orchestration results return a _Version

user = get_user(
dict(arn='arn:aws:iam::000000000000:user/myUser', role_name='myUser'),

print(json.dumps(user, indent=2, sort_keys=True))

"AccessKeys": [
"AccessKeyId": ...,
"CreateDate": ...,
"LastUsedDate": ...,
"Region": "us-east-1",
"ServiceName": ...,
"Status": "Active",
"UserName": ...,
"Arn": ...,
"CreateDate": ...,
"InlinePolicies": ...,
"LoginProfile": null,
"ManagedPolicies": [],
"MfaDevices": {},
"Path": "/",
"SigningCertificates": {},
"UserId": ...,
"UserName": ...,
"_version": 1

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cloudaux, version 1.0.0dev0
Filename, size File type Python version Upload date Hashes
Filename, size cloudaux-1.0.0dev0.tar.gz (15.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page