AWS Glue Local Development Environment: Three Ways to Build ETL Scripts

Develop ETL pipelines with AWS Glue. Optimize workflows. Reduce coding time. Streamline cloud analytics.

We built an ETL pipeline and data warehouse for EdCast using AWS Glue and S3. This article lists key learnings. The three ways to build and test Glue ETL scripts are the AWS-hosted development endpoint, a local notebook connected to that endpoint, and local development with the AWS Glue ETL library. The library is the reduced-cost option and supports unit testing.

AWS Glue Development Environment

Develop and test Glue ETL scripts in three ways:

  1. AWS-hosted development endpoint and notebook
  2. Local environment with development endpoint and Zeppelin notebook server
  3. Local development using the ETL library

Remote development endpoint and notebooks

The AWS development endpoint is a paid, managed Glue environment for building and testing ETL scripts. It includes Apache Spark, Glue libraries, and network configuration for secure access from Jupyter notebooks.

AWS Glue Development Endpoints provision EC2 instances with Jupyter Notebook. Users use these instances to write and test ETL code for Glue jobs.

See the AWS documentation for development endpoint details.

https://docs.aws.amazon.com/glue/latest/dg/console-development-endpoint.html

Advantages

Limitations

Use the development endpoint and Jupyter Notebook in the local environment

Run the Jupyter Notebook server in the local environment. Connect to the development endpoint via an SSH tunnel. Update the development endpoint with your specific RSA SSH public key. Select Rotate SSH Keys on the Development Endpoints page.

The Docker version of Jupyter 0.8.2 does not work with the Glue development endpoint due to bugs. Install the binary locally.

Advantages

Limitations

Local development with the AWS Glue ETL library

AWS released the AWS Glue library for local development. This library integrates Glue ETL jobs with the Maven build system for building and testing.

Developers can build ETL logic in Zeppelin, PyCharm Professional 2019.3, or Visual Studio Code. We use PySpark for ETL scripts. We develop these scripts in PyCharm. PyCharm supports local execution and debugging. It also supports remote debugging.

Benefits

For instructions on local setup and execution of Glue jobs, see:

https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-libraries.html

The next article details the steps to configure PyCharm with the Glue ETL library for local debugging.

For help building ETL pipelines on the cloud, see our data engineering services.

Related reading: how to set up a data pipeline on GCP and change data capture for Snowflake, PostgreSQL, MySQL and MongoDB.

Analyze AWS Glue Development Environment

Frequently asked questions

How do you run AWS Glue locally?
Use the AWS Glue ETL library for local development. It integrates Glue ETL jobs with the Maven build system, so you can build and test them on your own machine. Developers can write the ETL logic in Zeppelin, PyCharm Professional 2019.3, or Visual Studio Code, and run and debug it locally.
How much does an AWS Glue development endpoint cost?
The article reports that the development endpoint costs $1,500 per month, as of March 22, 2020. Additional costs apply for the EC2 instance that hosts the notebook server. Local development with the AWS Glue ETL library is listed as the reduced-cost option, so it avoids the monthly endpoint charge.
Can you unit test AWS Glue jobs?
The remote development endpoint lacks a streamlined way to write unit tests, and the local notebook setup has no simple method either. The AWS Glue ETL library for local development supports unit testing. The team writes its PySpark ETL scripts in PyCharm, which supports local execution and debugging, and also remote debugging.