Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MWAA Airflow 2.0 in AWS Snowflake connection not showing

Snowflake is not showing in the connections dropdown. I am using MWAA 2.0 and the providers are already in the requirements.txt MWAA uses python 3.7 dont know if this can be a thing

Requirements.txt:
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.2/constraints-3.7.txt"
asn1crypto
azure-common
azure-core
azure-storage-blob
boto3
botocore
certifi
cffi
chardet
cryptography
greenlet
idna
isodate
jmespath
msrest
numpy
oauthlib
oscrypto
pandas
pyarrow
pycparser
pycryptodomex
PyJWT
pyOpenSSL
python-dateutil
pytz
requests
requests-oauthlib
s3transfer
six
urllib3
apache-airflow-providers-http
apache-airflow-providers-snowflake
#apache-airflow-providers-snowflake[slack]
#apache-airflow-providers-slack
snowflake-connector-python >=2.4.1
snowflake-sqlalchemy >=1.1.0 \

like image 860
AXI Avatar asked Jun 01 '21 11:06

AXI


People also ask

How do you make a snowflake connection in airflow?

Configure snowflake connection in Airflow We can run below commands after activating the python virtual enviroment. 3. Now open localhost:8080 in the browser and go under Admin->Connections. Click on + symbol and add a new record Choose the connection type as Snowflake and fill other details as shown in screenshot.

What is airflow Mwaa?

Amazon Managed Workflows for Apache Airflow (MWAA) is a managed orchestration service for Apache Airflow1 that makes it easier to set up and operate end-to-end data pipelines in the cloud at scale.

How do I configure Amazon managed workflows for Apache Airflow (MWAA)?

Apache Airflow configuration options can be attached to your Amazon Managed Workflows for Apache Airflow (MWAA) environment as environment variables. You can choose from the suggested dropdown list, or specify custom configuration options for your Apache Airflow version on the Amazon MWAA console.

Is there a way to connect snowflake to AWS?

This might be worth to have a look: docs.aws.amazon.com/mwaa/latest/userguide/… If anyone is in this trouble, instead of choosing Snowflake in the dropdown, you can choose AWS as the connection and will work fine. this is a perfect answer. It took me a while to finally figure this one out after trying many different parameter combinations.

What version of airflow do I need for Snowflake?

My Airflow version is 2.0.2. According to MWAA docs, it should be enough to add apache-airflow-providers-snowflake==1.3.0 to the requirements file. When I added it to the existing MWAA env, where I had already tried many different combinations of packages, it helped partially.

How do I add a custom configuration to an Amazon MWAA environment?

Open the Environments page on the Amazon MWAA console. Choose an environment. Choose Edit . Choose Next . Choose Add custom configuration in the Airflow configuration options pane. Choose a configuration from the dropdown list and enter a value, or type a custom configuration and enter a value.


Video Answer


2 Answers

If anyone is in this trouble, instead of choosing Snowflake in the dropdown, you can choose AWS as the connection and will work fine.

like image 50
AXI Avatar answered Oct 18 '22 21:10

AXI


It took me a while to finally figure this one out after trying many different parameter combinations.

My full Snowflake URL is:

https://xx12345.us-east-2.aws.snowflakecomputing.com

The correct format for the Host field is:

xx12345.us-east-2.snowflakecomputing.com

For the Extra field, this is what worked for me:

{
    "account": "xx12345.us-east-2.aws",
    "warehouse": "my_warehouse_name",
    "database": "my_database_name"  
}

Make sure you put Amazon Web Services for the Conn Type, like @AXI said.

Also, I have these modules defined in my requirements.txt file:

apache-airflow-providers-snowflake==1.3.0
snowflake-connector-python==2.4.5
snowflake-sqlalchemy==1.2.4

My Airflow version is 2.0.2.

like image 2
Kevin Vo Avatar answered Oct 18 '22 21:10

Kevin Vo