feat: DM-4094: Add iam_role_arn to DatabaseConnectionConfig - #45
Merged
Conversation
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.
AaronBarnes07
left a comment
Collaborator
There was a problem hiding this comment.
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.
`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.
AaronBarnes07
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
iam_role_arntoDatabaseConnectionConfigfor cross account tagging.