airflow.providers.google.cloud.example_dags.example_cloud_sql_query

Example Airflow DAG that performs query in a Cloud SQL instance.

This DAG relies on the following OS environment variables

  • GCP_PROJECT_ID - Google Cloud project for the Cloud SQL instance

  • GCP_REGION - Google Cloud region where the database is created

  • GCSQL_POSTGRES_INSTANCE_NAME - Name of the postgres Cloud SQL instance

  • GCSQL_POSTGRES_USER - Name of the postgres database user

  • GCSQL_POSTGRES_PASSWORD - Password of the postgres database user

  • GCSQL_POSTGRES_PUBLIC_IP - Public IP of the Postgres database

  • GCSQL_POSTGRES_PUBLIC_PORT - Port of the postgres database

  • GCSQL_MYSQL_INSTANCE_NAME - Name of the postgres Cloud SQL instance

  • GCSQL_MYSQL_USER - Name of the mysql database user

  • GCSQL_MYSQL_PASSWORD - Password of the mysql database user

  • GCSQL_MYSQL_PUBLIC_IP - Public IP of the mysql database

  • GCSQL_MYSQL_PUBLIC_PORT - Port of the mysql database

Module Contents

Functions

get_absolute_path(path)

Returns absolute path.

Attributes

GCP_PROJECT_ID

GCP_REGION

GCSQL_POSTGRES_INSTANCE_NAME_QUERY

GCSQL_POSTGRES_DATABASE_NAME

GCSQL_POSTGRES_USER

GCSQL_POSTGRES_PASSWORD

GCSQL_POSTGRES_PUBLIC_IP

GCSQL_POSTGRES_PUBLIC_PORT

GCSQL_POSTGRES_CLIENT_CERT_FILE

GCSQL_POSTGRES_CLIENT_KEY_FILE

GCSQL_POSTGRES_SERVER_CA_FILE

GCSQL_MYSQL_INSTANCE_NAME_QUERY

GCSQL_MYSQL_DATABASE_NAME

GCSQL_MYSQL_USER

GCSQL_MYSQL_PASSWORD

GCSQL_MYSQL_PUBLIC_IP

GCSQL_MYSQL_PUBLIC_PORT

GCSQL_MYSQL_CLIENT_CERT_FILE

GCSQL_MYSQL_CLIENT_KEY_FILE

GCSQL_MYSQL_SERVER_CA_FILE

SQL

HOME_DIR

postgres_kwargs

mysql_kwargs

sql_proxy_binary_path

connection_names

tasks

prev_task

airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCP_PROJECT_ID[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCP_REGION[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_INSTANCE_NAME_QUERY[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_DATABASE_NAME[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_USER[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_PASSWORD[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_PUBLIC_IP[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_PUBLIC_PORT[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_CLIENT_CERT_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_CLIENT_KEY_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_POSTGRES_SERVER_CA_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_INSTANCE_NAME_QUERY[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_DATABASE_NAME[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_USER[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_PASSWORD[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_PUBLIC_IP[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_PUBLIC_PORT[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_CLIENT_CERT_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_CLIENT_KEY_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.GCSQL_MYSQL_SERVER_CA_FILE[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.SQL = ['CREATE TABLE IF NOT EXISTS TABLE_TEST (I INTEGER)', 'CREATE TABLE IF NOT EXISTS TABLE_TEST (I...[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.HOME_DIR[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.get_absolute_path(path)[source]

Returns absolute path.

airflow.providers.google.cloud.example_dags.example_cloud_sql_query.postgres_kwargs[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.mysql_kwargs[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.sql_proxy_binary_path[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.connection_names = ['proxy_postgres_tcp', 'proxy_postgres_socket', 'public_postgres_tcp',...[source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.tasks = [][source]
airflow.providers.google.cloud.example_dags.example_cloud_sql_query.prev_task[source]

Was this entry helpful?