Skip to content

Add optional owningProjectId to GlueDQResultToDataZonePublisher to avoid posting to the wrong project - #182

Open
ashwinrh wants to merge 1 commit into
aws-samples:masterfrom
ashwinrh:add-owning-project-filter-dq-datazone
Open

Add optional owningProjectId to GlueDQResultToDataZonePublisher to avoid posting to the wrong project#182
ashwinrh wants to merge 1 commit into
aws-samples:masterfrom
ashwinrh:add-owning-project-filter-dq-datazone

Conversation

@ashwinrh

@ashwinrh ashwinrh commented Jul 2, 2026

Copy link
Copy Markdown

Problem

GlueDQResultToDataZonePublisher resolves the target DataZone asset in search_asset_id via a domain-wide SearchListings on the table name, then posts the data quality results to every matching asset. SearchListings spans all owning projects, so when the same schema/table is published under more than one project, the transform posts to assets owned by projects the caller may not be a member of.

PostTimeSeriesDataPoints authorizes the write against the asset's owning project (there is no projectId input on the API). If the caller is not a member of that project, the call fails with:

An error occurred (AccessDeniedException) when calling the PostTimeSeriesDataPoints operation: User is not permitted to perform operation: PostTimeSeriesDataPoints

Because the post loop has no per-item error handling, one denied asset aborts the whole Glue job.

Fix

Add an optional owningProjectId parameter to post_dq_results_to_datazone / search_asset_id. When set, only assets owned by that project are selected (each SearchListings result already carries owningProjectId); same-named assets in other projects are skipped and logged.

owningProjectId defaults to None, so the change is fully backward compatible — existing jobs that omit it behave exactly as before.

Changes

  • post_dq_results_to_datazone.py: new optional owningProjectId arg on the entry function and search_asset_id; filter on the asset's owning project when provided.
  • post_dq_results_to_datazone.json: new optional owningProjectId parameter so it surfaces in the AWS Glue Studio custom transform UI.

Usage

Pass the id of the project that owns the asset you intend to publish DQ results to, e.g. owningProjectId="<yourProjectId>". Omit it to keep the previous name-only matching behavior.

search_asset_id resolves the target asset via a domain-wide SearchListings by
table name and posts DQ results to every match. When the same schema/table is
published under more than one project, this posts to assets owned by projects
the caller may not be a member of, causing AccessDeniedException on
PostTimeSeriesDataPoints (and aborting the job).

Add an optional owningProjectId parameter; when set, only assets owned by that
project are selected. Defaults to None, preserving existing behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant