pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python-beaver/python-beaver/commit/b11b635efbb7f2488cd4750e2853bebf9b845836

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-b40ec823a1a6a1af.css" /> Adding AWS profile authentication to SQS transport · python-beaver/python-beaver@b11b635 · GitHub
Skip to content

Commit b11b635

Browse files
author
Jamie Cressey
committed
Adding AWS profile authentication to SQS transport
1 parent 0d4a211 commit b11b635

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

beaver/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def __init__(self, args, logger=None):
9696
'sns_aws_topic_arn': '',
9797
'sqs_aws_access_key': '',
9898
'sqs_aws_secret_key': '',
99+
'sqs_aws_profile_name': '',
99100
'sqs_aws_region': 'us-east-1',
100101
'sqs_aws_queue': '',
101102
'sqs_aws_queue_owner_acct_id': '',

beaver/transports/sqs_transport.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ def __init__(self, beaver_config, logger=None):
1414

1515
self._access_key = beaver_config.get('sqs_aws_access_key')
1616
self._secret_key = beaver_config.get('sqs_aws_secret_key')
17+
self._profile = beaver_config.get('sqs_aws_profile_name')
1718
self._region = beaver_config.get('sqs_aws_region')
1819
self._queue_name = beaver_config.get('sqs_aws_queue')
1920
self._queue_owner_acct_id = beaver_config.get('sqs_aws_queue_owner_acct_id')
2021

2122
try:
22-
if self._access_key is None and self._secret_key is None:
23+
if self._profile:
24+
self._connection = boto.sqs.connect_to_region(self._region,
25+
profile_name=self._profile)
26+
elif self._access_key is None and self._secret_key is None:
2327
self._connection = boto.sqs.connect_to_region(self._region)
2428
else:
2529
self._connection = boto.sqs.connect_to_region(self._region,

docs/user/usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Beaver can optionally get data from a ``configfile`` using the ``-c`` flag. This
8383
* sns_aws_topic_arn: Topic ARN (must exist)
8484
* sqs_aws_access_key: Can be left blank to use IAM Roles or AWS_ACCESS_KEY_ID environment variable (see: https://github.com/boto/boto#getting-started-with-boto)
8585
* sqs_aws_secret_key: Can be left blank to use IAM Roles or AWS_SECRET_ACCESS_KEY environment variable (see: https://github.com/boto/boto#getting-started-with-boto)
86+
* sqs_aws_profile_name: Can be left blank to use IAM Roles AWS_SECRET_ACCESS_KEY environment variable, or fixed keypair (above) (see: https://github.com/boto/boto#getting-started-with-boto)
8687
* sqs_aws_region: Default ``us-east-1``. AWS Region
8788
* sqs_aws_queue: SQS queue (must exist)
8889
* sqs_aws_queue_owner_acct_id: Optional. Defaults ``None``. Account ID or Principal allowed to write to queue

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy