PluginWorks in Claude CodeCurrent
Aws data analytics
Data lake, analytics, and ETL workflows with S3 Tables, AWS Glue, and Athena.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install aws-data-analytics@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
13 skills
- amazon-opensearch-service
- authoring-mwaa-workflow
- connecting-to-data-source
- creating-data-lake-table
- debugging-mwaa-workflow
- exploring-data-catalog
- finding-data-lake-assets
- ingesting-into-data-lake
- querying-data-lake
- redshift-guide
- storing-and-querying-vectors
- testing-mwaa-workflow
- upgrading-mwaa-environments
1 MCP server
Security scan
Passed
Promptu's text scan of the files it could read didn't match any known risky patterns. It doesn't run the plugin, and a clean scan doesn't mean the plugin is safe.
Automated pattern check of 16 file(s) found nothing risky. Not a full audit.
Details
# aws-data-analytics
## Overview
This plugin brings AWS data engineering expertise directly into your coding assistant, covering the full data lifecycle across [AWS Analytics](https://aws.amazon.com/big-data/datalakes-and-analytics/) services; currently, skills are provided to assist with the following capability areas:
- **Data Lake Operations** — Build and operate a data lake on AWS: create managed Iceberg tables on Amazon S3 Tables, ingest data from diverse sources (S3, JDBC databases, Snowflake, BigQuery, DynamoDB, AWS Glue catalog tables), and query across default and federated catalogs with Amazon Athena.
- **Data Discovery** — Inventory and audit your AWS Glue Data Catalog across S3 Tables, Amazon Redshift-federated, and remote Iceberg catalogs. Resolve data asset references by name, keyword, column, or reverse-lookup from S3 location metadata in the catalog.
- **Vector Storage** — Store and query vector embeddings using Amazon S3 Vectors for cost-effective semantic search and RAG workloads.
- **External Connectivity** — Create and troubleshoot AWS Glue connections to JDBC databases (Oracle, SQL Server, PostgreSQL, MySQL, RDS, Aurora), Amazon Redshift, Snowflake, and BigQuery.
- **Search & Observability (OpenSearch)** — Migrate from Solr/Elasticsearch/self-managed OpenSearch into Amazon OpenSearch Service or Serverless, provision domains and collections, and build vector/semantic/hybrid search, log analytics, and trace analytics.
- **Data Warehouse (Amazon Redshift)** — Write Redshift SQL on a provisioned cluster or Serverless workgroup: DDL and distribution/sort keys, COPY/UNLOAD, system views, and the Data API.
- **Workflow Orchestration (Amazon MWAA)** — Author, test, and debug Apache Airflow DAGs on Amazon Managed Workflows for Apache Airflow (MWAA) provisioned environments and YAML workflows on MWAA Serverless, and upgrade provisioned environments to newer Airflow versions, including 2.x to 3.x.
## Agent Skills
| # | Skill | Description | Documentation |
| -- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- |
| 1 | `creating-data-lake-table` | Create managed Iceberg tables using Amazon S3 Tables with automatic compaction, AWS Glue catalog registration, and partitioning | [SKILL.md](skills/creating-data-lake-table/SKILL.md) |
| 2 | `ingesting-into-data-lake` | Import data from S3 files, JDBC databases, Snowflake, BigQuery, DynamoDB, or existing AWS Glue catalog tables into S3 Tables or standard Iceberg | [SKILL.md](skills/ingesting-into-data-lake/SKILL.md) |
| 3 | `querying-data-lake` | Execute and manage Athena SQL queries across default and federated catalogs (AWS Glue, S3 Tables, Amazon Redshift) | [SKILL.md](skills/querying-data-lake/SKILL.md) |
| 4 | `finding-data-lake-assets` | Resolve data lake asset references across AWS Glue Data Catalog, S3, S3 Tables, and Amazon Redshift by name, keyword, column, or S3 path | [SKILL.md](skills/finding-data-lake-assets/SKILL.md) |
| 5 | `exploring-data-catalog` | Full inventory and audit of AWS Glue Data Catalog assets across S3 Tables, Amazon Redshift-federated, and remote Iceberg catalogs | [SKILL.md](skills/exploring-data-catalog/SKILL.md) |
| 6 | `storing-and-querying-vectors` | Store and query vector embeddings using Amazon S3 Vectors for semantic search and RAG workloads | [SKILL.md](skills/storing-and-querying-vectors/SKILL.md) |
| 7 | `connecting-to-data-source` | Create and troubleshoot AWS Glue connections to JDBC databases, Amazon Redshift, Snowflake, and BigQuery | [SKILL.md](skills/connecting-to-data-source/SKILL.md) |
| 8 | `amazon-opensearch-service` | Migration, provisioning, vector/semantic/hybrid search, log analytics, and trace analytics for Amazon OpenSearch Service and Serverless | [SKILL.md](skills/amazon-opensearch-service/SKILL.md) |
| 9 | `redshift-guide` | Amazon Redshift SQL dialect, system views, metadata discovery, and Data API patterns, correcting common agent mistakes | [SKILL.md](skills/redshift-guide/SKILL.md) |
| 10 | `authoring-mwaa-workflow` | Author and deploy Airflow DAGs for Amazon MWAA provisioned environments and YAML workflows for MWAA Serverless | [SKILL.md](skills/authoring-mwaa-workflow/SKILL.md) |
| 11 | `testing-mwaa-workflow` | Trigger a deployed MWAA DAG or Serverless workflow, monitor it to completion, and retest after fixes | [SKILL.md](skills/testing-mwaa-workflow/SKILL.md) |
| 12 | `debugging-mwaa-workflow` | Root-cause failed MWAA runs and tasks, DAGs that don't appear, import errors, worker out-of-memory, and IAM denials | [SKILL.md](skills/debugging-mwaa-workflow/SKILL.md) |
| 13 | `upgrading-mwaa-environments` | Upgrade MWAA provisioned environments to a newer Airflow version, including 2.x to 3.x, with a blue/green or in-place strategy | [SKILL.md](skills/upgrading-mwaa-environments/SKILL.md) |
## MCP Servers
| # | Server | Description |
| - | --------- | ----------------------------------------------------------- |
| 1 | `aws-mcp` | AWS API access, documentation search, and SOP retrieval via [AWS MCP Server](https://docs.aws.amazon.com/aws-mcp/latest/userguide/what-is-mcp-server.html) |
## Installation
See [Quick Start](../../README.md#quick-start).
## Data Lake Operations
The data lake skills cover the jobs-to-be-done for building and operating a data lake on AWS. They follow AWS best practices as agent-readable instruction packages, guiding you from table creation through ingestion and querying.
### How It Works
- **Create tables** — The `creating-data-lake-table` skill sets up managed Iceberg tables on Amazon S3 Tables with automatic compaction, snapshot management, AWS Glue catalog registration, partitioning, and IAM access control.
- **Ingest data** — The `ingesting-into-data-lake` skill moves data from local files, S3, JDBC databases (Oracle, SQL Server, PostgreSQL, MySQL, RDS, Aurora, Amazon Redshift), Snowflake, BigQuery, DynamoDB, or existing AWS Glue catalog tables into your data lake. Supports one-time loads, recurring pipelines, and migrations.
- **Query data** — The `querying-data-lake` skill executes Athena SQL queries across default and federated catalogs, with workgroup selection, statement classification, cost tracking, and error recovery.
### Examples
- "Create an Iceberg table for our order events with daily partitioning"
- "Import our PostgreSQL sales data into the data lake"
- "Query the top 10 customers by revenue from our analytics table"
- "Migrate our existing Hive tables to Iceberg on S3 Tables"
## Data Discovery
The discovery skills help you understand what data exists in your AWS account and find specific assets quickly.
- **`exploring-data-catalog`** — Full inventory and audit across AWS Glue Data Catalog, S3 Tables, Amazon Redshift-federated, and remote Iceberg catalogs. Maps your data landscape, flags stale tables, and suggests improvements.
- **`finding-data-lake-assets`** — Resolves fuzzy data references ("our orders table", "the sales dataset") to concrete catalog entries using layered search across AWS Glue, S3, S3 Tables, and Amazon Redshift.
### Examples
- "What data do we have in our account?"
- "Inventory all catalogs and databases"
- "Find the table that has customer_id"
- "Where is our quarterly revenue data?"
## Vector Storage
The `storing-and-querying-vectors` skill provides cost-effective vector embedding storage and retrieval using Amazon S3 Vectors, optimized for long-term storage with subsecond query latency.
### Examples
- "Create a vector index for our product embeddings"
- "Store these document embeddings for RAG"
- "Find the most similar items to this query vector"
## External Connectivity
The `connecting-to-data-source` skill creates and troubleshoots AWS Glue connections to external databases. It discovers existing connections and candidate sources in your account, registers credentials securely via Secrets Manager or IAM DB auth, configures VPC networking, and tests end-to-end connectivity.
### Examples
- "Connect to our Oracle production database"
- "Set up an AWS Glue connection to Snowflake"
- "Test my existing BigQuery connection"
- "Troubleshoot the connection timeout on my RDS connection"
## Supported Environments
### Using the plugin in your local compute
In your local environment, configure AWS credentials and set your target region to get started.
#### Prerequisites
- An AWS account with access to AWS Analytics services (AWS Glue, Athena, S3 Tables, S3 Vectors)
- Local AWS credentials and config
- [uv](https://docs.astral.sh/uv/getting-started/installation/) (for MCP server)
#### Authentication and Authorization
Configure AWS credentials using one of the following methods:
- **AWS CLI** — Run [`aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) (IAM credentials) or [`aws sso login`](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html) (IAM Identity Center)
- **Environment variables** — Set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN`. See [Configuring environment variables](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html) for details.
Your IAM role needs permissions for the AWS services used by the skills you install. The relevant IAM action namespaces are:
- `airflow` - Amazon MWAA environments and Airflow REST API calls
- `airflow-serverless` - Amazon MWAA Serverless workflows and workflow runs (separate from `airflow`)
- `athena` - Query execution and workgroup management
- `glue` - Data Catalog operations and ETL jobs
- `s3` - Object storage operations
- `s3tables` - Managed Iceberg table operations (separate from `s3`)
- `s3vectors` - Vector storage operations (separate from `s3`)
Scope permissions to the resources your workload uses.
#### Configuration
- Set `AWS_DEFAULT_REGION` to your preferred AWS region (e.g., `us-east-1`). See [Configuring environment variables](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html) for details.
## Customizing Skills for Your Organization
The skills in this plugin follow AWS best practices, but they are fully customizable. You can fork the repository and modify any `SKILL.md` to reflect your organization's standards, naming conventions, approved data formats, or internal tooling. Workspace-level skills take precedence over global skills, so teams can maintain their own versions without affecting other users.
## Related Resources
- [AWS Analytics Services](https://aws.amazon.com/big-data/datalakes-and-analytics/)
- [Amazon S3 Tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables.html)
- [Amazon S3 Vectors](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors.html)
- [Amazon Athena User Guide](https://docs.aws.amazon.com/athena/latest/ug/what-is.html)
- [AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html)
- [Agent Skills open standard — Anthropic](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
- [AWS Agent Toolkit for AWS](https://github.com/aws/agent-toolkit-for-aws)
## License
This project is licensed under the Apache 2.0 License.
## skills/amazon-opensearch-service/SKILL.md
---
name: amazon-opensearch-service
description: Guides migration, provisioning, search, log-analytics, trace-analytics, and Agentic AI Assistant workflows for Amazon OpenSearch Service and Serverless across six capabilities — migration (Solr/ES/self-managed into AOS/AOSS, schema/query translation, sizing, cutover); provisioning (domain + AOSS lifecycle, upgrades, FGAC, monitoring); search (vector / semantic / hybrid / RAG with Bedrock); log-analytics (PPL, OSI, anomaly detection, Dashboards); trace-analytics (OTel spans, service maps, Data Prepper); ai-assistant (natural language data exploration, incident investigation, root cause analysis). Triggers on OpenSearch, AOS, AOSS, Elasticsearch, Solr, vector/k-NN/semantic/hybrid search, RAG, log analytics, PPL, trace analytics, ISM, FAISS, HNSW, Migration Assistant, UltraWarm, OR1, query my data, analyze logs, investigate errors, root cause analysis.
metadata:
version: "2"
---
# Amazon OpenSearch Service — the unified skill
This skill answers anything about Amazon OpenSearch Service or Serverless across six capabilities. **Step 0 below routes the question to ONE capability** and points at that capability's entry-point reference. Everything else — when to dispatch, sub-references, capability-specific facts, cross-capability links — lives in the entry-point reference for that capability.
> **AWS MCP server is recommended, not required.** Capability references show standard AWS CLI commands as the primary syntax (e.g., `aws opensearch describe-domain`, `aws opensearchserverless create-collection`). Where the AWS MCP server is available, its `call_aws` tool offers a streamlined alternative — but every operation in this skill MUST work via the AWS CLI alone. Data-plane HTTP calls against AOS / AOSS use `awscurl` for SigV4-signed requests; this works in both contexts.
## Step 0: detect the capability — first thing you do
Pick **one** of the six capabilities below. State the detected capability in your first sentence (e.g., *"Detected capability: SEARCH — semantic search setup with Bedrock embeddings."*). Then load the entry-point reference; that file describes when to dispatch, indexes the rest of the capability's files, and routes you to the next step.
| Capability | Entry-point reference |
|---|---|
| **migration** — Solr / Elasticsearch / self-managed OpenSearch into AOS or AOSS. Schema/query translation, sizing, cutover. | [`references/assessment-workflow.md`](references/assessment-workflow.md) |
| **provisioning** — Provisioning and managing AOS domains and AOSS collections. Lifecycle, upgrades, storage tiers, FGAC, monitoring. | [`references/provisioning-reference.md`](references/provisioning-reference.md) |
| **search** — Vector / semantic / hybrid / sparse / dense / RAG retrieval. Bedrock connectors, FAISS HNSW vs Lucene. | [`references/search-semantic-search-guide.md`](references/search-semantic-search-guide.md) |
| **log-analytics** — Log search, observability, PPL, OSI ingestion, anomaly detection, OpenSearch Dashboards. Splunk/Datadog/ELK alternatives. | [`references/log-analytics-guide.md`](references/log-analytics-guide.md) |
| **trace-analytics** — Distributed traces with OpenTelemetry. Span queries, service maps, Data Prepper. | [`references/trace-analytics-trace-queries.md`](references/trace-analytics-trace-queries.md) |
| **ai-assistant** — Agentic AI Assistant: auto-discovers indices, generates optimized PPL/DSL queries, summarizes results, and investigates incidents end-to-end. No manual query crafting needed. | [`references/ai-assistant.md`](references/ai-assistant.md) |
If a prompt spans capabilities (e.g., *"migrate from Solr AND set up RAG on the new domain"*), pick the dominant capability for the response and close with a one-line handoff to the other capability's entry-point ref.
## Universal rules (apply to ALL capabilities)
These rules apply to every response, regardless of capability. Capability-specific rules (sizing math, shape detection, Migration Assistant for Amazon OpenSearch Service capability matrix, k-NN engine selection) live in the entry-point references, not here.
- **Report header (every multi-section response).** Begin every multi-section response with a single fenced metadata block: `> Generated: <ISO 8601 timestamp> | Skill: amazon-opensearch-service v<N>`. Get the time by calling the `current_time` tool (returns ISO 8601 in UTC). Read the skill version from this file's frontmatter `version:` field. For one-line answers (terse FOCUSED_OPERATIONAL replies, anti-pattern refusals) the header is optional; for any multi-section deliverable it is REQUIRED. Place it immediately after the report title and before the first `##` heading.
- **No dollar estimates** (HARD CONSTRAINT). Never produce `$X/month`, `~$1,500`, or any dollar figure. Route every cost question to <https://calculator.aws> and stop. If a sub-reference contains dollar figures, treat them as informational context only and do NOT pass them through to the user.
- **No credential leakage** (HARD CONSTRAINT). Never include master usernames, KMS key ARNs, VPC endpoint URLs, instance IPs, or account IDs in generated output.
- **Pick one** for every A-vs-B decision. Name a primary recommendation in one line with a one-sentence reason. A *"go with B if..."* caveat is allowed AFTER the primary; never lead with conditional-only guidance.
- **Source restatement.** The first 2–3 sentences must restate the source (engine + version + scale) when known, or restate the customer's question in concrete terms. The very first text the user sees must NOT be tool narration, meta-commentary, the report title, or simply restating the question verbatim.
- **No marketing tone.** Do NOT use *"seamless"*, *"robust"*, *"best-in-class"*, *"production-hardened"*, *"enterprise-grade"*, *"world-class"*, *"cleanly"*, *"elegant"*. Do NOT stack 3+ vague hedges (*"typically"*, *"generally"*, *"usually"*, *"in most cases"*) in a single recommendation — be specific about when it does and does not apply.
- **Cross-capability handoff.** When a user prompt spans capabilities (e.g., *"migrate from Solr AND set up RAG on the new domain"*), pick the dominant capability for the response, then close with a one-line handoff: *"For \<other capability\>, see [`references/<other-capability>-<entry>.md`](...)."*
## Cross-cutting references (used across multiple capabilities)
These references are not capability-prefixed because they apply across capabilities. Capability entry-point references load them when relevant; SKILL.md never loads them directly.
- [`references/sizing.md`](references/sizing.md) — sizing math, instance family details, OR1 trade-offs, watermarks, JVM heap rules.
- [`references/vector-knn.md`](references/vector-knn.md) — k-NN engines, memory math, RAG ingestion patterns, ELSER alternatives.
- [`references/observability.md`](references/observability.md) — log analytics patterns, ISM, UltraWarm/Cold tiering, Splunk/Datadog migration playbooks.
- [`references/security.md`](references/security.md) — FGAC, encryption, VPC patterns, audit logs, compliance posture.
- [`references/personas.md`](references/personas.md) — communication style per persona.
- [`references/assessment-gotchas.md`](references/assessment-gotchas.md) — production gotcha catalog (cite by number in Migration specifics or Risks/blockers tables; each gotcha carries a `Category:` tag that determines its lane).
- [`references/assessment-knowledge-retrieval.md`](references/assessment-knowledge-retrieval.md) — topic → tool → URL recipe for batched verification.
Assets (`assets/`): report templates for FULL_ASSESSMENT renderings (Solr-source, ES-source, executive summary).
## What this skill does NOT do
- **Estimate dollar costs.** Pricing changes monthly and account-specific (RI, Savings Plan, EDP) discount math is outside this skill's reliable scope. Use <https://calculator.aws>.
- **Move data.** Use Migration Assistant for Amazon OpenSearch Service (Historical Data Migration for backfill, Live Traffic Migration for live cutover).
- **Build embedding models.** Use Amazon Bedrock or SageMaker.
- **Replace Splunk SPL or Datadog APM 1:1.** Some queries / detectors / dashboards need rewriting.
- **Tune relevance for a specific catalog.** Use OpenSearch Benchmark `big5` workload + your own judgment list.
## Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled
files from different places. Determine how the skill was loaded before reading
a reference or running a script:
- **Loaded through the AWS MCP server's `retrieve_skill` tool:** The skill is not
installed on the local filesystem. You MUST fetch each reference or script
via `retrieve_skill` with the `file` parameter (e.g.
`file="references/architecture.md"` or `file="scripts/deploy.py"`), and
run the script from the returned content. Do NOT `file_read` these paths
locally — they do not exist on disk.
- **Installed locally** (e.g. `.kiro/skills/your-skill/` or
`~/.claude/skills/your-skill/`): Read and run files from the local skill
directory using relative paths.
This distinction applies only to the skill's own packaged files. User data and
session artifacts are always read from and written to the user's working
directory. Never fetch or write customer data through `retrieve_skill`.
## skills/authoring-mwaa-workflow/SKILL.md
---
name: authoring-mwaa-workflow
description: >
Authors and deploys MWAA workflow artifacts: Python Airflow DAGs for provisioned
environments or YAML workflow files for Serverless. Covers operator selection,
timeout design, retry strategy, scheduling, failure notifications, idempotency,
and MWAA Serverless schema compliance. Deploys the artifact (S3 DAG upload or
Serverless CreateWorkflow/UpdateWorkflow), creates an environment inline when
approved, and redeploys fixes, then optionally hands off to
testing-mwaa-workflow. Triggers on: create a DAG, write a pipeline, build a
workflow, orchestrate tasks, Airflow DAG, data pipeline, schedule a job, deploy
a DAG, deploy a workflow, YAML workflow. Not applicable to converting or migrating
existing DAGs between provisioned and serverless (conversion is out of scope),
running or smoke-testing a deployed workflow (handled by testing-mwaa-workflow) or
diagnosing a failed run (handled by debugging-mwaa-workflow).
metadata:
version: "1"
---
# Authoring MWAA Workflows
> **AWS MCP server (optional but recommended):** running the AWS CLI commands in
> this skill through the AWS MCP server gives sandboxed execution and audit
> logging. Every command here also works with the plain AWS CLI, so the skill
> does not require the MCP server or any MCP-only tools.
Author production-grade workflow artifacts for Amazon MWAA. Routes to one
of two paths: Python DAG (provisioned) or YAML workflow (Serverless).
> **Execution note — poll in discrete steps:** whenever you wait for an AWS
> operation to reach a terminal or ready state, issue **one status check per
> call** and decide in your own loop whether to check again. Never block a
> single command or script on the wait (no `while`+`sleep` until done),
> regardless of the operation or how long it takes.
## Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled
files from different places. Determine how the skill was loaded before reading
a reference:
- **Loaded through the AWS MCP `retrieve_skill` tool:** The skill is not
installed on the local filesystem. You MUST fetch each reference via
`retrieve_skill` with the `file` parameter (e.g.
`file="references/authoring-provisioned-dag.md"`) and read the returned
content. Do NOT `file_read` these paths locally — they do not exist on disk.
- **Installed locally** (e.g. `.kiro/skills/authoring-mwaa-workflow/` or
`~/.claude/skills/authoring-mwaa-workflow/`): Read the files from the local
skill directory using relative paths.
This distinction applies only to the skill's own packaged files. User data and
session artifacts are always read from and written to the user's working
directory. Never fetch or write customer data through `retrieve_skill`.
## Step 0: Route to Path
Evaluate in this order:
1. **Resolvable target provided?** A target reference is a definitive
routing signal regardless of other keywords:
- A provisioned environment (ARN like
`arn:aws:airflow:<region>:<account>:environment/<name>`, or a name
resolvable via `aws mwaa get-environment`) → go to **Path A**.
- A Serverless workflow ARN
(`arn:aws:airflow-serverless:<region>:<account>:workflow/<name>`) → go to
**Path B**.
2. **Both-path keywords present?** If the request contains keywords from
both paths and no resolvable target, disambiguate by intent:
- `PythonOperator` is supported on Serverless, so an operator-level
`python` cue (`PythonOperator`, `python_callable`, "Python function/task")
alongside a Path B signal (`yaml`, `serverless`, workflow ARN) is NOT
ambiguous → go to **Path B**.
- Conversion context ("convert my Python DAG to serverless") → this
skill does not apply; conversion is out of scope.
- A genuine provisioned cue (`Python DAG`, `provisioned`) alongside a
Serverless cue with no target → ask the clarifying question.
3. **Exactly one path keyword?** Treat only deployment-target terms as Path A
signals: `provisioned`, `Python DAG`, or "a `.py` for my environment" → go
to **Path A**. `yaml` or `serverless` → go to **Path B**. Operator-level
Python mentions are not Path A signals.
4. **No routing signal?** "DAG" or "Workflow" alone is ambiguous — it does
NOT indicate a path. Ask: is the target **MWAA provisioned (Python
DAG)** or **MWAA Serverless (YAML)**?
---
## Paths
Follow the reference for the path you routed to (you do not need the other path's reference):
- **Path A — Python DAG (MWAA Provisioned):** [references/authoring-provisioned-dag.md](references/authoring-provisioned-dag.md)
- **Path B — YAML Workflow (MWAA Serverless):** [references/authoring-serverless-workflow.md](references/authoring-serverless-workflow.md)
After the routed path's **Write** step, continue with **Deploy & Test** below.
## Deploy & Test (optional, after Write)
Authoring owns all deployment and redeployment. Detail in
[references/deploying-mwaa.md](references/deploying-mwaa.md).
### Steps
1. **Ask** — present options based on whether the artifact has a schedule.
Frame the question using path-appropriate language:
- **Provisioned:** "deploy this DAG to an environment" (DAGs are uploaded
to an environment's S3 bucket).
- **Serverless:** "deploy this workflow" (workflows are standalone
resources — never say "deploy to an environment").
**If the DAG/workflow has a schedule:**
- **Deploy and test** — deploy, unpause, trigger a run now
- **Deploy and unpause** — deploy, unpause, let it run on schedule (no
immediate trigger)
- **Deploy only** — upload to S3, leave paused
**If the DAG/workflow has no schedule (manual-trigger only):**
- **Deploy and test** — deploy, trigger a run now
- **Deploy only** — upload to S3, leave paused (no "unpause" option —
nothing to schedule)
The user may also decline all options.
2. **Deploy:**
- **Provisioned:** upload the DAG to the environment's `SourceBucketArn`/
`DagS3Path`. Run post-deploy verification (see deploying-mwaa.md) to
confirm the scheduler parsed the new file without import errors or
dag_id conflicts. If no environment exists and the user approves,
create one inline (plan-validate-execute + explicit confirmation),
then poll `CREATING` -> `AVAILABLE` (~20-40 min). The user may instead
supply an existing environment.
- **Serverless:** `CreateWorkflow` (new) or `UpdateWorkflow` (redeploy);
the YAML is validated synchronously here. If the workflow uses
`PythonOperator`/`BashOperator`, first build and upload the code package
to S3 and pass it via `--code` (see
[references/serverless-code-packaging.md](references/serverless-code-packaging.md)
and [references/deploying-mwaa.md](references/deploying-mwaa.md)). The user
may instead supply an existing ARN.
- **Redeploy (fix loop):** the same upload / `UpdateWorkflow` path,
reused when testing-mwaa-workflow delegates an ARTIFACT or ENVIRONMENT
fix.
3. **If "Deploy and unpause" selected** — deploy per step 2, then unpause.
Do not trigger a run or invoke testing-mwaa-workflow.
4. **If "Deploy and test" selected** — deploy per step 2, unpause if
applicable, then invoke testing-mwaa-workflow with the resolved target
(env name + `dag_id`, or workflow ARN). That hand-off is testing's
delegated invocation mode.
> **HARD GATE:**
> If testing is requested — whether upfront ("deploy and test") or later in
> the conversation ("test it", "run it", "try it") — you MUST invoke
> testing-mwaa-workflow. Do NOT trigger, monitor, or verify DAG runs manually.
> "Deploy and unpause" is NOT a test request — it is a deploy-only action.
- **Production safety:** `create-environment`, `update-environment`,
`create-workflow`, and `update-workflow` mutate state — confirm each with
its impact stated. Warn on prod-named targets.
## Troubleshooting
| Error | Cause | Fix |
|-------|---------------------------------|-----------------------------------------------|
| dagrun_timeout kills DAG early | < timeout set in service called | Raise dagrun_timeout or lower service timeout |
| YAML validation rejects workflow | Wrong type or param | Use timedelta format; check allowlist |
| Operator not found in Serverless | Not allowlisted | Use a supported operator, PythonOperator/BashOperator, or Lambda |
| Serverless run: cannot extract code / corrupt env | Bad code package | Files at zip root, no `__pycache__`, ≤250 MB; repackage |
| Serverless Python task ImportError | Missing dep or wrong-platform wheel | Bundle as `manylinux2014_x86_64` / Py3.12 wheel; don't bundle pre-installed packages |
| Template variable undefined | Version mismatch | Check vars for exact Airflow version |
## References
- [references/dag-patterns.md](references/dag-patterns.md) — Python DAG templates
- [references/yaml-schema.md](references/yaml-schema.md) — MWAA Serverless format
- [references/deploying-mwaa.md](references/deploying-mwaa.md) — deploy, inline env creation, and redeploy
- [references/serverless-code-packaging.md](references/serverless-code-packaging.md) — Python/Bash code packaging, pre-installed packages, limits
- [references/authoring-provisioned-dag.md](references/authoring-provisioned-dag.md) — Path A: provisioned Python-DAG authoring steps (A1–A7)
- [references/authoring-serverless-workflow.md](references/authoring-serverless-workflow.md) — Path B: Serverless YAML authoring steps (B1–B5)
## Security Considerations
- **State-mutating operations** (`create`/`update-environment`,
`create`/`update-workflow`, S3 DAG upload) require explicit confirmation with
impact stated; warn on prod-named targets (see the Deploy HARD-GATE).
- **Least-privilege IAM**: the A5 check adds only the exact `Action`/`Resource`
pairs the artifact needs — never `*FullAccess` or `service:*`.
- **No hardcoded secrets/endpoints**: use Airflow Variables/Connections backed
by Secrets Manager or SSM Parameter Store; never emit credentials in DAG code
or CLI examples.
- **Serverless code packages** ship only the user's own modules plus pinned,
platform-matched wheels — no unreviewed third-party binaries.
- **Data protection**: keep sensitive data out of SNS/CloudWatch notification
payloads and logs; rely on their encryption.
- **Secure defaults for inline-created resources**: encrypt and lock down any
S3/MWAA/SNS/CloudWatch resource this skill creates — see [deploying-mwaa.md](references/deploying-mwaa.md) "Secure defaults".
- **AWS security best practices**: verify the security posture against the MWAA
User Guide's [Security best practices](https://docs.aws.amazon.com/mwaa/latest/userguide/security-best-practices.html)
page (and the [MWAA Serverless equivalent](https://docs.aws.amazon.com/mwaa/latest/mwaa-serverless-userguide/security-best-practices.html))
at runtime — AWS updates them over time; see [deploying-mwaa.md](references/deploying-mwaa.md) "Secure defaults".
## skills/connecting-to-data-source/SKILL.md
---
name: connecting-to-data-source
description: >-
Create and troubleshoot AWS Glue connections to JDBC databases (Oracle, SQL Server,
PostgreSQL, MySQL, RDS), Redshift, Snowflake, and BigQuery. Gathers connection hints
from user, discovers existing connections and RDS/Redshift candidates, registers
credentials in Secrets Manager or IAM DB auth, configures VPC, and tests. Triggers
on: connect to database, set up Glue connection, register data source, connect to
Snowflake/BigQuery/RDS, connection timeout, test connection, troubleshoot connection.
Do NOT use for moving data (use ingesting-into-data-lake), creating tables (use
creating-data-lake-table), queries (use querying-data-lake), catalog exploration
(use exploring-data-catalog), or SaaS (Salesforce, ServiceNow, SAP, MongoDB, Kafka).
metadata:
version: "1"
argument-hint: "'[source-type|connection-name|hostname]'"
---
# Connect to Data Source
Register an external data source with AWS Glue so downstream skills (ingesting-into-data-lake) can move data from it. A Glue connection stores the network config, driver, and credential reference for one source. Create once per source, reuse across jobs.
## Philosophy
**A connection is a named pipe, not a pipeline.** This skill produces a tested, reusable Glue connection. It does not move data.
## Common Tasks
You MUST execute commands using AWS MCP server tools when connected -- they provide validation, sandboxed execution, and audit logging. Fall back to AWS CLI only if MCP is unavailable. You MUST explain each step before executing.
## Workflow
### 1. Verify Dependencies and Context
- You MUST check whether AWS MCP tools or AWS CLI are available and inform the user if missing
- You MUST confirm target AWS region and verify credentials with `aws sts get-caller-identity`
### 2. Classify the Source
Ask the user which source type they want to connect to, or infer from hints:
| User says... | Source type | Connection type | Reference |
|---|---|---|---|
| "Oracle", "SQL Server", "Postgres", "MySQL", "RDS \<engine\>" | JDBC database | `JDBC` | [jdbc-setup.md](references/jdbc-setup.md) |
| "Redshift", "my cluster", "my data warehouse on AWS" | Redshift | `JDBC` | [jdbc-setup.md](references/jdbc-setup.md) (Redshift section) |
| "Snowflake" | Snowflake | `SNOWFLAKE` | [snowflake-setup.md](references/snowflake-setup.md) |
| "BigQuery", "Google analytics warehouse" | BigQuery | `BIGQUERY` | [bigquery-setup.md](references/bigquery-setup.md) |
If the user names DynamoDB or a local file, stop and tell them: DynamoDB is read directly by Glue without a connection, and local files belong in the ingesting-into-data-lake skill's local-upload workflow.
### 3. Gather Connection Hints from the User
You MUST ask for hints the user can provide -- do not guess.
**For all sources:**
- Desired connection name (lowercase, hyphens: `oracle-prod-sales`, `snowflake-analytics`)
- Existing Secrets Manager secret, or create one
- Is source reachable from a Glue VPC (same, peered, VPN, Direct Connect)
**JDBC:** hostname/endpoint, port, database, whether RDS/Aurora/self-managed, IAM DB auth enabled (Aurora/RDS MySQL/Postgres), SSL required.
**Snowflake:** account identifier, warehouse, role, default database, auth (password, key-pair, OAuth).
**BigQuery:** GCP project ID, location, whether service account JSON is provisioned.
### 4. Discover Existing Connections and Candidate Sources
Check what exists before creating.
**Existing Glue connections:**
```bash
aws glue get-connections --filter ConnectionType=<TYPE> --region <REGION>
```
If a suitable one exists, confirm and skip to Step 7.
**Candidate sources in account** (JDBC/Redshift only):
- RDS: `aws rds describe-db-instances`
- Aurora: `aws rds describe-db-clusters`
- Redshift: `aws redshift describe-clusters`
Present candidates to user; let them pick. See [discovery.md](references/discovery.md).
### 5. Register Credentials
You MUST encourage AWS Secrets Manager over plaintext passwords. You SHOULD prefer IAM database authentication where supported (Aurora/RDS MySQL and PostgreSQL, Redshift). See [credential-security.md](references/credential-security.md).
- You MUST confirm with user before creating a new Secrets Manager secret
- You MUST NOT write plaintext credentials into chat or logs
- For IAM DB auth, no secret is needed
### 6. Create the Glue Connection
Follow the source-specific reference for connection properties:
```bash
aws glue create-connection --connection-input '<JSON>' --region <REGION>
```
Private sources require `PhysicalConnectionRequirements` (SubnetId, SecurityGroupIdList, AvailabilityZone). See [network-setup.md](references/network-setup.md).
### 7. Test the Connection
You MUST test before handing off. Testing is two-phase: a quick API check, then an engine-level verification.
#### Phase A: Glue TestConnection (network and credential sanity check)
```bash
aws glue test-connection --connection-name <NAME> --region <REGION>
```
This validates that Glue can reach the source and authenticate. It does NOT prove the connection works end-to-end with the query engine the user plans to use.
#### Phase B: Engine-level verification
After TestConnection passes, verify the connection works with the user's intended engine by running a minimal query through it:
- **Glue ETL (default):** Run a smoke-test Glue job that reads one row via the connection. See [troubleshooting.md](references/troubleshooting.md).
- **Athena:** If the user plans to query via Athena with a federated connector, run a `SELECT 1` through the Athena connection to confirm the Lambda-based connector can reach the source.
- **Glue Crawler:** If the user plans to crawl the source, run a test crawl on a single table.
Phase B catches issues that TestConnection misses: driver compatibility at job runtime, catalog configuration, Spark-level serialization, and engine-specific auth flows (e.g., Snowflake SNOWFLAKE type works in ETL but not via JDBC crawlers).
On success in both phases, tell user the connection name is ready for `ingesting-into-data-lake`. On failure in either phase, Step 8.
### 8. Troubleshoot (only if test failed)
Diagnose in order: network, credentials, driver. See [troubleshooting.md](references/troubleshooting.md).
**Constraints:**
- You MUST check VPC routing, security groups, and S3 VPC endpoint before blaming credentials
- You MUST verify Glue role can read the Secrets Manager secret
- You MUST NOT rotate credentials without user confirmation
## Argument Routing
- No args: Walk through Steps 1-7 interactively
- Source type keyword (e.g., `snowflake`, `oracle`): Skip to Step 2 with the type prefilled
- Existing connection name: Skip to Step 7 (test) then Step 8 if failing
- Hostname or RDS endpoint: Skip to Step 4 with the candidate prefilled
## Gotchas
- Glue's `SNOWFLAKE` connection type is distinct from `JDBC` configured for Snowflake. You MUST use `SNOWFLAKE` for Spark ETL jobs; do not use JDBC.
- Connection names are immutable. Choose carefully.
- `PhysicalConnectionRequirements.AvailabilityZone` MUST match the subnet's AZ or the connection fails at job runtime, not creation time.
- IAM database authentication tokens expire in 15 minutes. The Glue job generates a fresh token on each connection; do not cache.
- An S3 VPC gateway endpoint MUST exist in the VPC used by private-source connections. Without it, Glue jobs cannot read their scripts or write results to S3.
## Troubleshooting
| Error | Likely cause | Fix |
|---|---|---|
| `Connect timed out` | VPC routing, SG rule, or NAT gateway missing | See [troubleshooting.md](references/troubleshooting.md) |
| `Access denied for user` / `ORA-01017` | Credentials wrong, Secrets Manager access missing, or IAM DB auth misconfigured | See [troubleshooting.md](references/troubleshooting.md) |
| `No suitable driver found` | Custom driver JAR not set or wrong class name | See [troubleshooting.md](references/t

