- Newest
- Most votes
- Most comments
When connecting AWS Glue to Snowflake, there are two authentication methods supported: username/password and key-pair authentication. Your understanding about the connection behavior needs some clarification:
-
The sfOptions parameters you're using don't bypass the AWS Glue connection's network configuration. When you create a Glue connection to Snowflake and specify VPC, subnet, and security group settings, those network configurations are applied regardless of the authentication method you use. The NAT Gateway configuration in your VPC will still mask the Glue job's IP address when connecting to Snowflake, even when using key-pair authentication.
-
You can use key-pair authentication while still leveraging the network settings from your Glue connection. To do this, create a Snowflake connection in the AWS Glue Data Catalog that includes your VPC, subnet, and security group configurations. Then store your authentication details (including the private key) in AWS Secrets Manager. When you reference this connection in your Glue job, it will use both the network settings and the authentication method you've configured.
-
No, using username and password is not the only way to connect to Snowflake when using a NAT Gateway to mask IP addresses. You can use key-pair authentication (
sfUserandpem_private_key) while still benefiting from the NAT Gateway configuration in your VPC. The authentication method and network routing are separate concerns.
To properly set up a connection that uses key-pair authentication and your NAT Gateway:
- Create a secret in AWS Secrets Manager with your
sfUserandpem_private_key - Create a Snowflake connection in the AWS Glue Data Catalog, specifying your VPC, subnet (with NAT Gateway), and security group
- Reference this connection in your Glue job
This approach will ensure your Glue job connects to Snowflake using key-pair authentication while routing traffic through your NAT Gateway.
Sources
Snowflake connections - AWS Glue
Unlock scalable analytics with a secure connectivity pattern in AWS Glue to read from or write to Snowflake | AWS Big Data Blog
Creating a Snowflake connection - AWS Glue
AWS Glue connection properties - AWS Glue
can you provide sample configuration both for AWS Secret manager and Glue script
Relevant content
- asked a year ago
- AWS OFFICIALUpdated a year ago

can you provide sample configuration both for AWS Secret manager and Glue script