惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Secure Thoughts
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
D
Docker
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
TaoSecurity Blog
TaoSecurity Blog
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
Cyberwarzone
Cyberwarzone
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
P
Palo Alto Networks Blog
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
Engineering at Meta
Engineering at Meta
S
Schneier on Security
Google DeepMind News
Google DeepMind News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Hacker News: Ask HN
Hacker News: Ask HN
小众软件
小众软件
博客园 - 聂微东
S
Security Affairs
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
T
Threatpost
博客园 - 【当耐特】
L
LINUX DO - 热门话题
G
Google Developers Blog
P
Privacy & Cybersecurity Law Blog
A
About on SuperTechFans
F
Fortinet All Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How to Test Private Database Access from AWS Glue Before Running ETL Jobs
David💻 · 2026-04-27 · via DEV Community

When building ETL workloads in AWS, one of the first problems we usually face is not the transformation logic itself.

It is connectivity.

Before writing a complex ETL job, we need to confirm that AWS Glue can actually reach the source database, authenticate correctly, resolve the endpoint, and execute a basic query.

In this article, we will configure an AWS Glue connection to a private database, attach the proper VPC networking, configure the Glue IAM role, and create a simple validation script that can be reused before building production ETL workloads.

Requirements

  • AWS account
  • AWS Glue
  • A private database such as Amazon RDS, Aurora, PostgreSQL, MySQL, SQL Server, or Oracle
  • VPC, private subnets, and security groups
  • IAM role for AWS Glue
  • Basic knowledge of JDBC connections

The proposed architecture

The idea is simple.

AWS Glue will run inside a VPC-connected environment and use a Glue Connection to reach a private database endpoint.

The architecture will look like this:

Architecture

The main goal is to validate the connection before using it in a real ETL process.

This is especially useful when the final ETL job will later extract data from the database, transform it with Spark, and write the result into S3, Redshift, or another analytical target.

Why validate connectivity first?

When a Glue ETL job fails, the error is not always obvious.

Sometimes the problem is:

  • The Glue job is not attached to the right VPC connection
  • The selected subnet cannot reach the database
  • The security group does not allow traffic
  • The database security group does not allow inbound access from Glue
  • The database endpoint does not resolve correctly
  • The IAM role cannot read Secrets Manager
  • The JDBC URL is incorrect
  • The database user does not have enough permissions
  • The database engine requires a specific JDBC driver Instead of testing all of this inside a large ETL script, we can create a small validation job first.

This helps isolate the problem.

Walkthrough

Our database should be reachable privately.

For example, if we are using Amazon RDS or Aurora, the database should have a private endpoint like:

database.cluster-xxxxxx.us-east-1.rds.amazonaws.com

Enter fullscreen mode Exit fullscreen mode

The database should be deployed inside private subnets.

The database security group should allow inbound traffic from the Glue job security group on the database port.

Example ports:

PostgreSQL: 5432
MySQL: 3306
SQL Server: 1433
Oracle: 1521

Enter fullscreen mode Exit fullscreen mode

Example security group rule:

Type: PostgreSQL
Protocol: TCP
Port: 5432
Source: sg-glue-job

Enter fullscreen mode Exit fullscreen mode

This means that the database will only accept traffic coming from the security group used by AWS Glue.

Now we create a security group for AWS Glue.

Example:

Security group name: sg-glue-private-db
Description: Security group used by AWS Glue to connect to private databases
VPC: same VPC as the database

Outbound rule:

Type: All traffic
Destination: database security group or VPC CIDR

For a more restricted configuration, you can allow only the database port.

Example:

Type: PostgreSQL
Protocol: TCP
Port: 5432
Destination: sg-database

Enter fullscreen mode Exit fullscreen mode

AWS also recommends adding a self referencing inbound rule for the Glue security group when using Glue with resources in a VPC.

Example:

Type: All TCP
Protocol: TCP
Port range: 0 - 65535
Source: sg-glue-private-db

Enter fullscreen mode Exit fullscreen mode

This helps AWS Glue components communicate correctly within the selected VPC networking configuration.

Now we should focus on the vpc endpoints. If the Glue job is running in a private subnet without internet access, we need to think about how Glue will access other AWS services.

At minimum, for many ETL workloads, the Glue job may need access to:

vpc endpoints

For S3, we can create a Gateway VPC Endpoint.

Service: com.amazonaws.<region>.s3
Type: Gateway
Route tables: private subnet route tables

Enter fullscreen mode Exit fullscreen mode

For Secrets Manager, CloudWatch Logs, Glue, and STS, we can use Interface VPC Endpoints.

Examples:

com.amazonaws.<region>.secretsmanager
com.amazonaws.<region>.logs
com.amazonaws.<region>.glue
com.amazonaws.<region>.sts

Enter fullscreen mode Exit fullscreen mode

This is important because a Glue job running in private subnets may fail if it needs to access AWS services but has no NAT Gateway or VPC endpoints.

Now we create the IAM role that AWS Glue will assume when running the job.

Example role name:

AWSGlueServiceRole

The trust policy should allow AWS Glue to assume the role:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "glue.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Attach the AWS managed policy:

AWSGlueServiceRole

Then add permissions based on what the job needs.

If the job reads credentials from AWS Secrets Manager:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadDatabaseSecret",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue"
      ],
      "Resource": "arn:aws:secretsmanager:us-east-1:<account-id>:secret:<secret-name>*"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

If the job needs to write logs and temporary files to S3:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "GlueS3Access",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::my-glue-assets-bucket",
        "arn:aws:s3:::my-glue-assets-bucket/*"
      ]
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

This keeps the role focused on the specific resources needed by the validation job.

Instead of hardcoding credentials inside the Glue job, we can store them in AWS Secrets Manager.

Example secret value:

{
  "username": "etl_user",
  "password": "StrongPasswordExample",
  "engine": "mysql",
  "host": "database.cluster-xxxxxx.us-east-1.rds.amazonaws.com",
  "port": 3306,
  "dbname": "appdb"
}

Enter fullscreen mode Exit fullscreen mode

The database user should have only the permissions required for ETL.

For a validation job, this user can be very limited.

Example PostgreSQL permission:

GRANT CONNECT ON DATABASE appdb TO etl_user;
GRANT USAGE ON SCHEMA public TO etl_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO etl_user;

Enter fullscreen mode Exit fullscreen mode

For a simple connectivity test, even a user that can only execute SELECT 1 is enough.

Finally let's focus on the connection creation.

Go to AWS Glue → Data Catalog → Connections → Create connection

Select the connection type.

For example:

Connection type: JDBC
Database engine: Mysql

mysql

On the JDBC be sure to select your DB whenever you have it configured at RDS or Aurora, select your secret or input your username/password user of the db

Note: take into consideration that this will automatically create a secret if the credential type if username and password

Then configure the network section:

VPC: same VPC where the database is reachable
Subnet: private subnet with route access to the database
Security group: sg-glue-private-db

Save the connection.

Example connection name:

glue-private-postgres-connection

After the connection is created you can validate it by selecting the connection → Actions → Test Connection

Now we can create a simple Glue validation job

Note: When connecting to a private database, passing only JDBC parameters is not enough. The Glue job also needs an attached Glue Connection because the connection provides the VPC, subnet, and security group configuration required for private network access.

Let's create a new Glue Job by selecting Author code with a script editor, in this case we're going to use SPARK and Start fresh

spark

For the script we are going to use the following example:

from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)
MYSQL_CONNECTION_NAME = "Mysql connections"
# --- Test MySQL Connection ---
print("=" * 60)
print(f"TESTING: {MYSQL_CONNECTION_NAME}")
print("=" * 60)
try:
    mysql_df = glueContext.create_dynamic_frame.from_options(
        connection_type="mysql",
        connection_options={
            "useConnectionProperties": "true",
            "connectionName": MYSQL_CONNECTION_NAME,
            "dbtable": "information_schema.tables",
        },
        transformation_ctx="mysql_test"
    )
    row_count = mysql_df.count()
    print(f"SUCCESS - MySQL connection works. Rows retrieved: {row_count}")
    mysql_df.toDF().show(5, truncate=False)
except Exception as e:
    print(f"FAILED - MySQL connection error: {str(e)}")
print("=" * 60)
print("CONNECTION TESTS COMPLETE")
print("=" * 60)
job.commit()

Enter fullscreen mode Exit fullscreen mode

This script is a simple connectivity test. It initializes the standard Glue and Spark context, then attempts to read from the MySQL information_schema.tables metadata table using a pre configured Glue connection. The connection itself stores the database host, port, credentials, and VPC networking details, so the script doesn't need to hardcode any of that. If the read succeeds, it prints the row count and a sample of the data; if it fails, it catches the exception and prints the error. It's essentially a "can Glue reach this database?" health check useful for validating network paths, security groups, and credentials before building out the actual ETL logic.

Now in Job Details we can use the following configuration:

Configurations glue

Job name: glue-private-db-connection-validation
IAM role: AWSGlueServiceRole
Type: Spark
Glue version: Glue 5.1
Language: Python 3
Worker type: G.1X
Number of workers: 2

Enter fullscreen mode Exit fullscreen mode

In Advanced properties, attach the Glue connection:

Connections

This is important because this is what makes the job use the configured VPC, subnet, and security group.

After finishing the configurations select Save and Run.

run

At this point, we have validated that the Glue job can connect to the private database.

output log

Common errors and how to troubleshoot them

Timeout connecting to database: Usually this means a networking issue.
Check:

  • Database security group allows inbound traffic from Glue security group
  • Glue security group allows outbound traffic to the database
  • The selected subnet can route to the database
  • The database endpoint is private and reachable from the VPC
  • Network ACLs are not blocking traffic

Authentication failed: Usually this means a credential issue.

Check:

  • Username
  • Password
  • Secret value
  • Glue connection credentials
  • Database user status
  • Password expiration policies

Access denied to Secrets Manager: Usually this means the Glue role does not have permission to read the secret.

Check:

  • "Action": "secretsmanager:GetSecretValue"
  • Also validate that the secret ARN is correct.

No route to host: This usually means Glue connection is running in a subnet that cannot reach the database.

Check:

  • VPC selected in the Glue connection
  • Subnet selected in the Glue connection
  • Route tables
  • VPC peering or Transit Gateway routing if the database is in another VPC
  • DNS resolution

Could not resolve hostname: This usually means DNS resolution is not working.

Check:

  • VPC DNS resolution
  • VPC DNS hostnames
  • Private hosted zones
  • Custom DNS servers
  • Route 53 resolver rules if using hybrid networking

Job cannot access S3: If the job is running in a private subnet, validate one of these options:

  • S3 Gateway VPC Endpoint
  • NAT Gateway route to the internet
  • Correct route table association

This is important because Glue jobs usually need S3 for scripts, temporary files, logs, or output data.

Recommendations

For production ETL workloads, I would recommend:

  • Use AWS Secrets Manager instead of hardcoded passwords
  • Use least privilege IAM policies
  • Use private subnets for Glue connectivity
  • Restrict database inbound rules to the Glue security group
  • Use VPC endpoints when there is no NAT Gateway
  • Keep Glue validation jobs separate from transformation jobs
  • Add CloudWatch logging and alarms
  • Validate the connection before each major ETL deployment
  • Use a dedicated database user for ETL workloads
  • Avoid using database admin credentials
  • Store Glue scripts in version control
  • Parameterize database names, tables, and validation queries