nailo2c opened a new pull request, #66510:
URL: https://github.com/apache/airflow/pull/66510

   closes: #35347
   
   # How
   
   Add the `sql_proxy_enable_iam_login` parameter to support 
`-enable_iam_login` in `CloudSqlProxyRunner`.
   
   # What
   
   Reproducer DAG:
   ```python
   import os
   from datetime import datetime
   
   from airflow import DAG
   from airflow.providers.google.cloud.operators.cloud_sql import 
CloudSQLExecuteQueryOperator
   
   DAG_ID = "cloudsql_proxy_iam_reproduce"
   GCP_CONN_ID = os.environ.get("AIRFLOW_35347_GCP_CONN_ID", 
"google_cloud_default")
   CLOUDSQL_CONN_ID = os.environ.get("AIRFLOW_35347_CLOUDSQL_CONN_ID", 
"cloudsql_proxy_iam_postgres")
   
   with DAG(
       dag_id=DAG_ID,
       schedule=None,
       start_date=datetime(2026, 1, 1),
   ) as dag:
       CloudSQLExecuteQueryOperator(
           task_id="query_cloudsql_with_proxy_iam",
           gcp_conn_id=GCP_CONN_ID,
           gcp_cloudsql_conn_id=CLOUDSQL_CONN_ID,
           sql=["SELECT 1"],
       )
   ```
   
   Connection:
   ```json
   {
        "conn_type": "gcpcloudsql",
        "login": "<your-sa-name>@<your-project>.iam.gserviceaccount.com",
        "password": "",
        "host": "127.0.0.1",
        "port": 5432,
        "schema": "test_db",
        "extra": {
                "database_type": "postgres",
                "project_id": "<your-project>",
                "location": "us-central1",
                "instance": "<your-instance-name>",
                "use_proxy": "True",
                "sql_proxy_use_tcp": "True",
                "sql_proxy_enable_iam_login": "True"
        }
   } 
   ```
   
   ### Before fix
   <img width="1918" height="669" alt="af_35347_before_fix" 
src="https://github.com/user-attachments/assets/509b41eb-9b0f-4fdd-92f3-fcdfcf0d39e3";
 />
   
   ### After fix
   <img width="2555" height="750" alt="af_35347_after_fix" 
src="https://github.com/user-attachments/assets/0c3261ec-cc6f-42c9-b7e2-9d09bac371c1";
 />
   
   ### System test
   <img width="1432" height="804" alt="af_35347_system_test" 
src="https://github.com/user-attachments/assets/1dc0430b-377b-4e65-91e3-9e7b52a58dfb";
 />
   
   Cloud SQL instance lifecycle (create → delete) executed as expected.
   <img width="1439" height="437" alt="Screenshot 2026-05-06 at 8 24 43 PM" 
src="https://github.com/user-attachments/assets/b0c40dcf-5648-429d-ad1f-7f5dd89c219f";
 />
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, 
please
   change below checkbox to `[X]` followed by the name of the tool, uncomment 
the "Generated-by".
   -->
   
   - [x] Yes (please specify the tool below)
     Generated-by: Codex 5.5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to