GlueJob para Notebook con AWS CDK y TypeScript

Guía para desplegar AWS Glue con CDK TypeScript: convierte notebooks ipynb a scripts Python, usa GlueVersion compatible y glueetl para ejecuciones fiables desde S3.

29 ago 2025 • 4 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Introducción: Estoy usando AWS CDK con TypeScript para desplegar un Glue job cuyo contenido de notebook está almacenado en un bucket S3. El job se despliega pero no reconoce el tipo como Notebook y además aparece un error relativo a la versión de Glue. A continuación se explica por qué sucede esto y cómo resolverlo paso a paso.

Problema común: AWS Glue distingue entre jobs que ejecutan scripts compatiblemente con glueetl y sesiones interactivas o notebooks de Glue Studio. Un archivo notebook con extensión ipynb no se ejecuta directamente como un Glue job tradicional. Si el job se crea indicando un tipo Notebook de forma explícita desde CDK puede que la API no lo acepte y muestre errores sobre el tipo de trabajo y la versión de Glue.

Causas habituales: 1) El recurso Job en la API de Glue requiere un Command Name como glueetl para ejecutar scripts ETL almacenados en S3. 2) Los notebooks interactivos de Glue son otros artefactos pensados para sesiones y no siempre son invocables como jobs tradicionales sin convertirlos a script Python. 3) La propiedad GlueVersion debe coincidir con las capacidades del script o del entorno; versiones incompatibles provocan errores de validacion.

Paso 1 convertir el notebook a script: Si tienes un notebook ipynb, exportalo a un script Python y subelo a S3. Asi el Job puede referenciar el ScriptLocation y ejecutarlo con Command Name glueetl. Alternativa: reutiliza el notebook desde Glue Studio iniciando una sesion interactiva en vez de un job.

Paso 2 configurar el Job en CDK: En TypeScript usa la clase de Glue adecuada y especifica un ejecutable compatible. Ejemplo de pseudocodigo en CDK TypeScript indicando placeholders sin comillas ni literales exactos para que adaptes a tu entorno: const job = new glue.Job(this, JOB_ID, { executable: glue.JobExecutable.pythonEtl({ glueVersion: glue.GlueVersion.V3_0, pythonVersion: glue.PythonVersion.THREE, script: S3_PATH_TO_PYTHON_SCRIPT }), maxCapacity: 10, role: IAM_ROLE }); Asegurate de reemplazar JOB_ID, S3_PATH_TO_PYTHON_SCRIPT e IAM_ROLE por tus valores.

Paso 3 ajustar GlueVersion y WorkerType: Verifica que la GlueVersion elegida es compatible con las librerias y la version de Python que usa tu script. Si usas bibliotecas modernas requiere GlueVersion mas reciente. Ajusta WorkerType y NumberOfWorkers o MaxCapacity segun las necesidades de memoria y CPU y segun los requisitos de la version de Glue seleccionada.

Errores concretos y soluciones rapidas: si el error indica que el Job Type no es Notebook, cambia el Command Name a glueetl y usa ScriptLocation apuntando al script Python en S3. si el error es sobre Glue version, revisa la lista de versiones soportadas en la consola AWS Glue y elige una version compatible, o adapta el script a la version seleccionada.

Alternativa usando sesiones interactivas: Si realmente necesitas ejecutar un notebook como tal, emplea Glue Studio y crea una sesion interactiva o un desarrollo de notebook en Glue Studio. Desde alli puedes ejecutar celdas y luego exportar un script que se puede programar como job.

Recomendaciones practicas: 1) Mantén el notebook original y añade un pipeline que convierta ipynb a py para ejecuciones automatizadas. 2) Valida en la consola de Glue que el job funciona antes de intentar desplegar via CDK. 3) Revisa permisos de IAM para que Glue pueda leer el objeto S3 donde esta el script o notebook.

Beneficios para empresas: En Q2BSTUDIO somos especialistas en desarrollo de software a medida, aplicaciones a medida, inteligencia artificial y ciberseguridad. Podemos ayudar a diseñar pipelines reproducibles en AWS usando servicios cloud aws y azure, optimizar jobs de Glue, crear arquitecturas para servicios inteligencia de negocio y desplegar soluciones de ia para empresas y agentes IA integrados con Power BI para analitica avanzada.

Servicios que ofrecemos: Servicios de desarrollo de software a medida, integracion de soluciones de inteligencia artificial, auditorias y planes de ciberseguridad, migracion y optimizacion en servicios cloud aws y azure, soluciones de servicios inteligencia de negocio y dashboards con power bi, desarrollo de agentes IA y automatizacion de procesos con IA.

Palabras clave para posicionamiento: aplicaciones a medida, software a medida, inteligencia artificial, ciberseguridad, servicios cloud aws y azure, servicios inteligencia de negocio, ia para empresas, agentes IA, power bi.

Contacto y siguiente paso: Si quieres que desde Q2BSTUDIO revisemos tu CDK TypeScript y el Glue job para convertir notebooks en jobs productivos, optimizar GlueVersion y asegurar compatibilidad con tus librerias, contactanos para un analisis y propuesta tecnica personalizada.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat