You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/03 18:58:31 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #25416: Hide unused fields for Amazon Web Services connection

Taragolis commented on code in PR #25416:
URL: https://github.com/apache/airflow/pull/25416#discussion_r937031237


##########
docs/apache-airflow-providers-amazon/connections/aws.rst:
##########
@@ -104,6 +104,33 @@ If you are configuring the connection via a URI, ensure that all components of t
 Examples
 --------
 
+**Snippet for create Connection as URI**:
+  .. code-block:: python
+
+    import os
+    from airflow.models.connection import Connection
+
+
+    conn = Connection(
+        conn_id="sample_aws_connection",
+        conn_type="aws",
+        login="AKIAIOSFODNN7EXAMPLE",  # Reference to AWS Access Key ID
+        password="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",  # Reference to AWS Secret Access Key
+        extra={
+            # Specify extra parameters here
+            "region_name": "eu-central-1",
+        },
+    )
+
+    # Generate Environment Variable Name and Connection URI
+    env_key, conn_uri = f"AIRFLOW_CONN_{conn.conn_id.upper()}", conn.get_uri()

Review Comment:
   Oh... No reason. Just a copy-paste from my personal scratch file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org