Make docs on AWS_... env vars consistent, cross reference FAQ (#5005)

This commit is contained in:
Huon Wilson 2022-04-06 21:20:12 +10:00 committed by GitHub
parent 2aa3788174
commit ab06e62172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,11 +215,14 @@ You need to ensure that the mocks are actually in place.
export AWS_SECRET_ACCESS_KEY='testing'
export AWS_SECURITY_TOKEN='testing'
export AWS_SESSION_TOKEN='testing'
export AWS_DEFAULT_REGION='us-east-1'
#. **VERY IMPORTANT**: ensure that you have your mocks set up *BEFORE* your `boto3` client is established.
This can typically happen if you import a module that has a `boto3` client instantiated outside of a function.
See the pesky imports section below on how to work around this.
.. note:: By default, the region must be one supported by AWS, see :ref:`Can I mock the default AWS region?` for how to change this.
Example on usage
~~~~~~~~~~~~~~~~
If you are a user of `pytest`_, you can leverage `pytest fixtures`_ to help set up your mocks and other AWS resources that you would need.