This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 7aeaee93d1 Add JSON format example for Amazon Web Services Connection
(#27496)
7aeaee93d1 is described below
commit 7aeaee93d10147ce25d4ae6f7bfcbf2941e03fc6
Author: Andrey Anshin <[email protected]>
AuthorDate: Mon Nov 7 06:09:17 2022 +0400
Add JSON format example for Amazon Web Services Connection (#27496)
---
.../connections/aws.rst | 36 +++++++++++++++++++---
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/docs/apache-airflow-providers-amazon/connections/aws.rst
b/docs/apache-airflow-providers-amazon/connections/aws.rst
index 0e55ded0f0..e610219bfe 100644
--- a/docs/apache-airflow-providers-amazon/connections/aws.rst
+++ b/docs/apache-airflow-providers-amazon/connections/aws.rst
@@ -118,7 +118,9 @@ If you are configuring the connection via a URI, ensure
that all components of t
Examples
--------
-**Snippet for create Connection as URI**:
+Snippet to create Connection and convert to URI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. code-block:: python
import os
@@ -146,14 +148,31 @@ Examples
os.environ[env_key] = conn_uri
print(conn.test_connection())
-**Using instance profile**:
+Using instance profile
+^^^^^^^^^^^^^^^^^^^^^^
+
+ This will use boto's default credential look-up chain (the profile named
"default" from the ~/.boto/ config files,
+ and instance profile when running inside AWS)
+
+ **URI format example**
+
.. code-block:: bash
export AIRFLOW_CONN_AWS_DEFAULT=aws://
- This will use boto's default credential look-up chain (the profile named
"default" from the ~/.boto/ config files, and instance profile when running
inside AWS)
-**With a AWS IAM key pair**:
+ **JSON format example**
+
+ .. code-block:: bash
+
+ export AIRFLOW_CONN_AWS_DEFAULT='{"conn_type": "aws"}'
+
+
+With a AWS IAM key pair
+^^^^^^^^^^^^^^^^^^^^^^^
+
+ **URI format example**
+
.. code-block:: bash
export
AIRFLOW_CONN_AWS_DEFAULT=aws://AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI%2FK7MDENG%2FbPxRfiCYEXAMPLEKEY@
@@ -161,6 +180,15 @@ Examples
Note here, that the secret access key has been URL-encoded (changing ``/``
to ``%2F``), and also the
trailing ``@`` (without which, it is treated as ``<host>:<port>`` and will
not work)
+ **JSON format example**
+
+ .. code-block:: bash
+
+ export AIRFLOW_CONN_AWS_DEFAULT='{
+ "conn_type": "aws",
+ "login": "AKIAIOSFODNN7EXAMPLE",
+ "password": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
+ }'
Examples for the **Extra** field
--------------------------------