Skip to content

feat: DM-4094: Add iam_role_arn to DatabaseConnectionConfig - #45

Merged
alxboyle merged 3 commits into
mainfrom
DM-4094-tagging-role
Aug 21, 2026
Merged

feat: DM-4094: Add iam_role_arn to DatabaseConnectionConfig#45
alxboyle merged 3 commits into
mainfrom
DM-4094-tagging-role

Conversation

@alxboyle

Copy link
Copy Markdown
Contributor

Adds iam_role_arn to DatabaseConnectionConfig for cross account tagging.

DataMasque can tag the AWS resource behind a connection after a run. When the
resource is in a different AWS account it must assume a role there, and the ARN is
carried on the connection. Declare `iam_role_arn` on `DatabaseConnectionConfig` so
the client is typed and documented for it, rather than relying on the base model's
`extra="allow"` to forward an undeclared key.

Pruned for engines that cannot be an RDS instance, Aurora cluster or Redshift
cluster, mirroring how `s3_redshift_iam_role` is pruned for non-Redshift engines.
On Redshift the two coexist and mean different things: `s3_redshift_iam_role` is the
role the cluster uses to reach S3, this is the role DataMasque assumes to tag it.
@alxboyle
alxboyle requested a review from AaronBarnes07 August 19, 2026 04:05
@alxboyle alxboyle self-assigned this Aug 19, 2026

@AaronBarnes07 AaronBarnes07 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed alongside datamasque !3646 and datamasque-automation !1192.

Consistent with the agent side: I checked that mssql_linked and databricks_lakebase are excluded here exactly as they are in the agent's mixin set, that MssqlLinkedServerConnectionConfig inherits the field but prunes it via its own database_type, and that the pruning mirrors how s3_redshift_iam_role is already handled. HISTORY correctly notes the 3.26.16 server requirement.

Two comments inline, both minor.

On sequencing: this wants to land and release as 1.2.5 first, so datamasque-automation !1192 can bump its pin from 1.2.2 and drop the # type: ignore[call-arg] it's currently carrying for this field.

Comment thread tests/test_connections.py
Comment thread datamasque/client/models/connection.py
`mssql_linked` inherits the field through `MssqlLinkedServerConnectionConfig` and is
excluded only by its own enum value; `databricks_lakebase` is AWS-hosted, so it reads
like an omission until you know it presents no endpoint tagging can act on. Both prune
correctly today, and covering them is what stops someone widening the list later.
@alxboyle
alxboyle merged commit 329de3a into main Aug 21, 2026
9 checks passed
@alxboyle
alxboyle deleted the DM-4094-tagging-role branch August 21, 2026 07:29
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.

2 participants