Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove group_federation for serverless #836

Merged
merged 16 commits into from
Jun 13, 2024
Merged
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240531-113620.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Remove group_federation when using serverless for iam authentication
Fleid marked this conversation as resolved.
Show resolved Hide resolved
time: 2024-05-31T11:36:20.397521-07:00
custom:
Author: fleid
Issue: "835"
11 changes: 7 additions & 4 deletions dbt/adapters/redshift/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,13 @@ def _iam_user_kwargs(self) -> Dict[str, Any]:
def _iam_role_kwargs(self) -> Dict[str, Optional[Any]]:
logger.debug("Connecting to redshift with 'iam_role' credentials method")
kwargs = self._iam_kwargs
kwargs.update(
group_federation=True,
db_user=None,
)

# It's a role, we're ignoring the user
kwargs.update(db_user=None)

# Serverless shouldn't get group_federation, Provisoned clusters should
if self.credentials.cluster_id:
kwargs.update(group_federation=True)

if iam_profile := self.credentials.iam_profile:
kwargs.update(profile=iam_profile)
Expand Down
Loading