Full inventory guide
Package 1.0.23. Run scripts only in your approved AWS environment. Kumilu serves generic code and synthetic examples; real results remain in your selected S3 location. Language variants change comments and explanatory docstrings only. Field names, AWS APIs, runtime messages and execution logic are shared.
| Variant | Standalone file | Columns | Latest-run times |
|---|---|---|---|
| Lite, default | glue_workflow_inventory_lite.py | 32 | No history reads |
| Lite + run times | glue_workflow_inventory_lite_with_runs.py | 38 | Job JST times, raw Workflow times and both durations |
| Full | glue_workflow_inventory.py | 64 | Included, plus detailed configuration JSON |
Run in AWS Glue
- Create a separate Python Shell 3.9 Job with the analytics library set and the approved execution Role. Suggested settings: 0.0625 DPU and Job Max retries = 0.
- Upload the selected standalone script. No explicit keys, profile or role assumption are used.
- Grant the required static read APIs and S3 output access, then run with:
--REGION ap-northeast-1
--OUTPUT_S3_URI s3://example-output-bucket/glue-investigation/
Each run writes exactly one tab-separated UTF-8-SIG CSV. The filename is YYYYMMDD_HHMMSS_glue_job_inventory.csv, using startup time in JST (UTC+9). Same-second runs to the same prefix can collide. Legacy URIs ending in glue_job_inventory.csv are accepted but produce a timestamped basename.
Use iam-inventory-policy.json as a scoped example; replace sample account, Region and bucket paths. PutObject must allow ????????_??????_glue_job_inventory.csv inside the approved prefix. Runtime script-read, trust, logging and any KMS permissions are separate; use iam-runtime-policy.json as an example and add the exact selected script path. No policies are changed by the scripts.
Matching and blank values
- Exact Job names establish membership; Graph provides Workflow associations, Actions identify target Jobs and Predicate identifies predecessors. Standalone Jobs are included and Job names are deduplicated.
- A unique Workflow fills its name and description; multiple memberships leave scalar Workflow fields blank and produce warnings. Job Description is a separate field.
- A unique SCHEDULED Trigger supplies raw ScheduleCron. A unique CONDITIONAL Trigger supplies PreviousJobs in original order, comma-separated, without deduplication. Those names alone do not encode states, AND/ANY or Crawler conditions.
- Multiple Triggers leave scalar Trigger/Cron/PreviousJobs fields blank. Lite variants keep their names in warnings but omit details; use Full for complete per-Trigger JSON.
- NonOverridableArguments overrides same-name DefaultArguments in dedicated parameter columns. Trigger arguments are not merged into guessed effective runtime values.
- Lite variants omit full parameter and Trigger JSON, including unlisted custom arguments. They do not redact selected values. Full preserves structured JSON with sensitive-key redaction.
- Missing values are blank, never fabricated as zero. Actual 0/false values remain. Check InvestigationWarnings before treating blanks as absent resources.
Workflow names may come from Triggers before metadata is loaded. Version 1.0.20 fetches each newly referenced Workflow once by exact name with GetWorkflow(IncludeGraph=False), filling Description and, in run-enabled variants, LastRun caches without changing existing associations. No new API type or IAM action is needed. Check InvestigationWarnings: metadata unavailable identifies missing details; Description empty or absent identifies blank/missing description (also inspect read errors); no run history available identifies missing LastRun. A running completion remains blank.
Request pacing and warning scope (1.0.21)
All three inventory scripts wait one second before each Glue HTTP send, including SDK retries. Edit GLUE_REQUEST_INTERVAL_SECONDS at the top to 2.0 for slower reads. Glue uses standard backoff with up to eight total attempts; retry quota may stop earlier. S3 retains its original four-attempt configuration and has no added delay. The standalone permission checker is unchanged. Each 100 sends add at least about 100 seconds of deliberate wait, plus network and backoff time. Account/Region traffic from other tools may still cause throttling.
Workflow/Trigger detail warnings follow related Job rows by exact name. Unmatched details remain in the full log. Genuine global enumeration/association warnings may still repeat across rows. A repeated global summary does not mean every Job read failed.
Leading zero hours/minutes are omitted: 5 m 30 s, 05 s, or 00 s; otherwise 1 h 5 m 30 s. After the first nonzero unit, keep smaller zero units: 1 h 0 m 00 s.
Latest-run times
This variant requires glue:GetJobRuns on approved Job ARNs. It reads GetJobRuns(JobName=..., MaxResults=1) and takes the first, newest run. Workflow times reuse GetWorkflow.LastRun without a separate history enumeration. Only a unique Workflow fills its scalar time fields.
Job StartedOn/CompletedOn are displayed in JST (UTC+9), preserving fractional seconds; naive timestamps are interpreted as UTC and invalid values are blank with a warning. Workflow timestamps retain the SDK timezone and precision. WorkflowCurrentLastDuration is computed and displayed as x h x m xx s (for example 1 h 5 m 30 s), discarding fractional seconds and allowing hours above 24: CompletedOn minus StartedOn when finished, or one shared inventory snapshot minus StartedOn for RUNNING/STOPPING. Invalid or negative results remain blank; no extra API or IAM permission is needed. LatestJobRunDuration reads only ExecutionTime from the latest Job run (resource consumption seconds) and formats it as x h x m xx s with leading zero hours/minutes omitted. It never calculates end minus start, even when both timestamps exist. Missing ExecutionTime stays blank; invalid values stay blank with a warning. Actual zero displays as 00 s. No additional API or permission is needed. An unfinished newest run has a blank end time; an older completion is never substituted. No-history and AccessDenied are different warnings. Job and Workflow latest runs may belong to different batches. Run arguments, properties and logs are not exported. The permission checker still checks static APIs only.
Full-only options
| Parameter | Default | Behavior |
|---|---|---|
| --USE_TRIGGER_API | true | Enumerate/get Triggers; false uses Workflow Graph data only and can miss standalone Triggers. |
| --USE_GET_JOBS | false | Optional GetJobs fallback/cache; requires glue:GetJobs. |
| --FAIL_ON_PARTIAL | false | true uploads available rows, then returns exit code 2 if warnings exist. |
Full uses 64 columns and retains per-Trigger Actions/conditions, parameter-source JSON and static Job/Workflow configuration backups with structured sensitive-key redaction. Unknown Job parameters stay in JSON. It retains ExecutionClass and JobRunQueuingEnabled. Supported schedule expressions also produce UTC/JST columns; complex calendar cases retain the raw expression and warnings. RootScheduleCron is reserved and remains blank.
JobName is column 1; Job Description is column 13. See FIELDS.md for every column.
=VLOOKUP(A2,Inventory!$A:$BL,13,FALSE)
Errors, output and validation
Read failures produce warnings and may still allow partial output. Lite variants stop without upload when discovery has warnings and no Jobs were found; successful empty discovery may write a header. Programming errors stop lite collection. Full preserves its existing partial-result behavior and optional strict exit mode. A successful Job does not prove the inventory is exhaustive.
Excel-risk prefixes receive an apostrophe and a warning. Values over 32,767 characters are retained, not truncated. Import using Tab and Text types, especially JobName, to preserve leading zeros. SDK retries are bounded and list enumeration is paginated. Scripts do not modify or start business Glue resources.
The canonical scripts passed 98 offline tests (90 mock/standard and 8 SDK contract/fake-transport tests). Each comment-language variant also passes Python 3.9 parsing and executable-AST equivalence checks. These checks do not replace real company Glue/IAM/S3/KMS/network and Excel validation.