Skip to content

Commit 4afd6de

Browse files
Merge pull request #49 from michaelthomasletts/dev
enhancing usage section docs
2 parents 96a0416 + 070cfb0 commit 4afd6de

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/usage.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
Usage
44
*****
55

6+
In order to use this package, you must have AWS credentials configured on your machine locally. Check the :ref:`authorization documentation <authorization>` for additional details.
7+
8+
Quick and Dirty
9+
---------------
10+
11+
The following code block illustrates a minimal, quick and dirty configuration for initializing :class:`boto3_refresh_session.session.RefreshableSession` and subsequently creating an S3 client.
12+
13+
.. code-block:: python
14+
import boto3_refresh_session
15+
16+
assume_role_kwargs = {
17+
'RoleArn': '<your-role-arn>',
18+
'RoleSessionName': '<your-role-session-name>',
19+
'DurationSeconds': '<your-selection>',
20+
}
21+
session = boto3_refresh_session.RefreshableSession(
22+
assume_role_kwargs=assume_role_kwargs
23+
)
24+
s3 = session.client(service_name='s3')
25+
buckets = s3.list_buckets()
26+
27+
Detailed Instructions
28+
---------------------
29+
630
In order to use :class:`boto3_refresh_session.session.RefreshableSession`, you are required to configure parameters for the :meth:`STS.Client.assume_role` method.
731

832
.. code-block:: python

0 commit comments

Comments
 (0)