Helpful decorators for aws things
Documentation: https://github.com/devstuff-io/aws-decorators
pip install aws-decorators
boto_client(service_name, client_type='client', region=AWS_REGION,
client_param_name='client', region_param_name='region')
Parameters
Name | Description | Required | Default |
---|---|---|---|
service_name |
Name of the boto3 client or resource | yes | |
client_type |
boto3 client or resource | no | client |
region |
The aws region to use | no | us-east-1 |
client_param_name |
Name of the function argument for the client or resource | no | client |
region_param_name |
Name of the function argument for the aws region name | no | region |
Usage
from aws_decorators import boto_client
@boto_client('lambda')
def do_something_with_lambda(client=None, region=None):
return client.get_function(FunctionName='foo')
@boto_client('dynamodb', client_type='resource', client_param_name='fooby')
def do_something_with_dynamodb(fooby=None, region=None):
return fooby.create_table(...)
See contributors section on GitHub.